<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <title>Test Report</title>
    <link href="assets/style.css" rel="stylesheet" type="text/css"/></head>
  <body onLoad="init()">
    <script>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


function toArray(iter) {
    if (iter === null) {
        return null;
    }
    return Array.prototype.slice.call(iter);
}

function find(selector, elem) { // eslint-disable-line no-redeclare
    if (!elem) {
        elem = document;
    }
    return elem.querySelector(selector);
}

function findAll(selector, elem) {
    if (!elem) {
        elem = document;
    }
    return toArray(elem.querySelectorAll(selector));
}

function sortColumn(elem) {
    toggleSortStates(elem);
    const colIndex = toArray(elem.parentNode.childNodes).indexOf(elem);
    let key;
    if (elem.classList.contains('result')) {
        key = keyResult;
    } else if (elem.classList.contains('links')) {
        key = keyLink;
    } else {
        key = keyAlpha;
    }
    sortTable(elem, key(colIndex));
}

function showAllExtras() { // eslint-disable-line no-unused-vars
    findAll('.col-result').forEach(showExtras);
}

function hideAllExtras() { // eslint-disable-line no-unused-vars
    findAll('.col-result').forEach(hideExtras);
}

function showExtras(colresultElem) {
    const extras = colresultElem.parentNode.nextElementSibling;
    const expandcollapse = colresultElem.firstElementChild;
    extras.classList.remove('collapsed');
    expandcollapse.classList.remove('expander');
    expandcollapse.classList.add('collapser');
}

function hideExtras(colresultElem) {
    const extras = colresultElem.parentNode.nextElementSibling;
    const expandcollapse = colresultElem.firstElementChild;
    extras.classList.add('collapsed');
    expandcollapse.classList.remove('collapser');
    expandcollapse.classList.add('expander');
}

function showFilters() {
    const filterItems = document.getElementsByClassName('filter');
    for (let i = 0; i < filterItems.length; i++)
        filterItems[i].hidden = false;
}

function addCollapse() {
    // Add links for show/hide all
    const resulttable = find('table#results-table');
    const showhideall = document.createElement('p');
    showhideall.innerHTML = '<a href="javascript:showAllExtras()">Show all details</a> / ' +
                            '<a href="javascript:hideAllExtras()">Hide all details</a>';
    resulttable.parentElement.insertBefore(showhideall, resulttable);

    // Add show/hide link to each result
    findAll('.col-result').forEach(function(elem) {
        const collapsed = getQueryParameter('collapsed') || 'Passed';
        const extras = elem.parentNode.nextElementSibling;
        const expandcollapse = document.createElement('span');
        if (extras.classList.contains('collapsed')) {
            expandcollapse.classList.add('expander');
        } else if (collapsed.includes(elem.innerHTML)) {
            extras.classList.add('collapsed');
            expandcollapse.classList.add('expander');
        } else {
            expandcollapse.classList.add('collapser');
        }
        elem.appendChild(expandcollapse);

        elem.addEventListener('click', function(event) {
            if (event.currentTarget.parentNode.nextElementSibling.classList.contains('collapsed')) {
                showExtras(event.currentTarget);
            } else {
                hideExtras(event.currentTarget);
            }
        });
    });
}

function getQueryParameter(name) {
    const match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
    return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}

function init () { // eslint-disable-line no-unused-vars
    resetSortHeaders();

    addCollapse();

    showFilters();

    sortColumn(find('.initial-sort'));

    findAll('.sortable').forEach(function(elem) {
        elem.addEventListener('click',
            function() {
                sortColumn(elem);
            }, false);
    });
}

function sortTable(clicked, keyFunc) {
    const rows = findAll('.results-table-row');
    const reversed = !clicked.classList.contains('asc');
    const sortedRows = sort(rows, keyFunc, reversed);
    /* Whole table is removed here because browsers acts much slower
     * when appending existing elements.
     */
    const thead = document.getElementById('results-table-head');
    document.getElementById('results-table').remove();
    const parent = document.createElement('table');
    parent.id = 'results-table';
    parent.appendChild(thead);
    sortedRows.forEach(function(elem) {
        parent.appendChild(elem);
    });
    document.getElementsByTagName('BODY')[0].appendChild(parent);
}

function sort(items, keyFunc, reversed) {
    const sortArray = items.map(function(item, i) {
        return [keyFunc(item), i];
    });

    sortArray.sort(function(a, b) {
        const keyA = a[0];
        const keyB = b[0];

        if (keyA == keyB) return 0;

        if (reversed) {
            return keyA < keyB ? 1 : -1;
        } else {
            return keyA > keyB ? 1 : -1;
        }
    });

    return sortArray.map(function(item) {
        const index = item[1];
        return items[index];
    });
}

function keyAlpha(colIndex) {
    return function(elem) {
        return elem.childNodes[1].childNodes[colIndex].firstChild.data.toLowerCase();
    };
}

function keyLink(colIndex) {
    return function(elem) {
        const dataCell = elem.childNodes[1].childNodes[colIndex].firstChild;
        return dataCell == null ? '' : dataCell.innerText.toLowerCase();
    };
}

function keyResult(colIndex) {
    return function(elem) {
        const strings = ['Error', 'Failed', 'Rerun', 'XFailed', 'XPassed',
            'Skipped', 'Passed'];
        return strings.indexOf(elem.childNodes[1].childNodes[colIndex].firstChild.data);
    };
}

function resetSortHeaders() {
    findAll('.sort-icon').forEach(function(elem) {
        elem.parentNode.removeChild(elem);
    });
    findAll('.sortable').forEach(function(elem) {
        const icon = document.createElement('div');
        icon.className = 'sort-icon';
        icon.textContent = 'vvv';
        elem.insertBefore(icon, elem.firstChild);
        elem.classList.remove('desc', 'active');
        elem.classList.add('asc', 'inactive');
    });
}

function toggleSortStates(elem) {
    //if active, toggle between asc and desc
    if (elem.classList.contains('active')) {
        elem.classList.toggle('asc');
        elem.classList.toggle('desc');
    }

    //if inactive, reset all other functions and add ascending active
    if (elem.classList.contains('inactive')) {
        resetSortHeaders();
        elem.classList.remove('inactive');
        elem.classList.add('active');
    }
}

function isAllRowsHidden(value) {
    return value.hidden == false;
}

function filterTable(elem) { // eslint-disable-line no-unused-vars
    const outcomeAtt = 'data-test-result';
    const outcome = elem.getAttribute(outcomeAtt);
    const classOutcome = outcome + ' results-table-row';
    const outcomeRows = document.getElementsByClassName(classOutcome);

    for(let i = 0; i < outcomeRows.length; i++){
        outcomeRows[i].hidden = !elem.checked;
    }

    const rows = findAll('.results-table-row').filter(isAllRowsHidden);
    const allRowsHidden = rows.length == 0 ? true : false;
    const notFoundMessage = document.getElementById('not-found-message');
    notFoundMessage.hidden = !allRowsHidden;
}
</script>
    <h1>baogao.html</h1>
    <p>Report generated on 03-Oct-2025 at 22:30:43 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> v3.1.1</p>
    <h2>Summary</h2>
    <p>4 tests ran in 8.68 seconds. </p>
    <p class="filter" hidden="true">(Un)check the boxes to filter the results.</p><input checked="true" class="filter" data-test-result="passed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="passed">0 passed</span>, <input checked="true" class="filter" data-test-result="skipped" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="skipped">0 skipped</span>, <input checked="true" class="filter" data-test-result="failed" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="failed">4 failed</span>, <input checked="true" class="filter" data-test-result="error" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="error">0 errors</span>, <input checked="true" class="filter" data-test-result="xfailed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xfailed">0 expected failures</span>, <input checked="true" class="filter" data-test-result="xpassed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xpassed">0 unexpected passes</span>
    <h2>Results</h2>
    <table id="results-table">
      <thead id="results-table-head">
        <tr>
          <th class="sortable result initial-sort" col="result">Result</th>
          <th class="sortable" col="name">Test</th>
          <th class="sortable" col="duration">Duration</th>
          <th class="sortable links" col="links">Links</th></tr>
        <tr hidden="true" id="not-found-message">
          <th colspan="4">No results found. Try to check the filters</th></tr></thead>
      <tbody class="failed results-table-row">
        <tr>
          <td class="col-result">Failed</td>
          <td class="col-name">conftest/conftest.py::TestGqzy1::test_put_putbook1[11-中华上下五千年-1-历史]</td>
          <td class="col-duration">2.04</td>
          <td class="col-links"></td></tr>
        <tr>
          <td class="extra" colspan="4">
            <div class="log">self = &lt;urllib3.connection.HTTPConnection object at 0x000001E26DF10370&gt;<br/><br/>    def _new_conn(self) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Establish a socket connection and set nodelay settings on it.<br/>    <br/>        :return: New socket connection.<br/>        &quot;&quot;&quot;<br/>        try:<br/>&gt;           sock = connection.create_connection(<br/>                (self._dns_host, self.port),<br/>                self.timeout,<br/>                source_address=self.source_address,<br/>                socket_options=self.socket_options,<br/>            )<br/><br/>.venv\lib\site-packages\urllib3\connection.py:199: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\util\connection.py:85: in create_connection<br/>    raise err<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>address = (&#x27;127.0.0.1&#x27;, 8000), timeout = None, source_address = None<br/>socket_options = [(6, 1, 1)]<br/><br/>    def create_connection(<br/>        address: tuple[str, int],<br/>        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,<br/>        source_address: tuple[str, int] | None = None,<br/>        socket_options: _TYPE_SOCKET_OPTIONS | None = None,<br/>    ) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Connect to *address* and return the socket object.<br/>    <br/>        Convenience function.  Connect to *address* (a 2-tuple ``(host,<br/>        port)``) and return the socket object.  Passing the optional<br/>        *timeout* parameter will set the timeout on the socket instance<br/>        before attempting to connect.  If no *timeout* is supplied, the<br/>        global default timeout setting returned by :func:`socket.getdefaulttimeout`<br/>        is used.  If *source_address* is set it must be a tuple of (host, port)<br/>        for the socket to bind as a source address before making the connection.<br/>        An host of &#x27;&#x27; or port 0 tells the OS to use the default.<br/>        &quot;&quot;&quot;<br/>    <br/>        host, port = address<br/>        if host.startswith(&quot;[&quot;):<br/>            host = host.strip(&quot;[]&quot;)<br/>        err = None<br/>    <br/>        # Using the value from allowed_gai_family() in the context of getaddrinfo lets<br/>        # us select whether to work with IPv4 DNS records, IPv6 records, or both.<br/>        # The original create_connection function always returns all records.<br/>        family = allowed_gai_family()<br/>    <br/>        try:<br/>            host.encode(&quot;idna&quot;)<br/>        except UnicodeError:<br/>            raise LocationParseError(f&quot;&#x27;{host}&#x27;, label empty or too long&quot;) from None<br/>    <br/>        for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):<br/>            af, socktype, proto, canonname, sa = res<br/>            sock = None<br/>            try:<br/>                sock = socket.socket(af, socktype, proto)<br/>    <br/>                # If provided, set socket level options before connecting.<br/>                _set_socket_options(sock, socket_options)<br/>    <br/>                if timeout is not _DEFAULT_TIMEOUT:<br/>                    sock.settimeout(timeout)<br/>                if source_address:<br/>                    sock.bind(source_address)<br/>&gt;               sock.connect(sa)<br/><span class="error">E               ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝，无法连接。</span><br/><br/>.venv\lib\site-packages\urllib3\util\connection.py:73: ConnectionRefusedError<br/><br/>The above exception was the direct cause of the following exception:<br/><br/>self = &lt;urllib3.connectionpool.HTTPConnectionPool object at 0x000001E26DEECBB0&gt;<br/>method = &#x27;PUT&#x27;, url = &#x27;/editBook/4&#x27;<br/>body = b&#x27;{&quot;id&quot;: 11, &quot;book&quot;: &quot;\\u4e2d\\u534e\\u4e0a\\u4e0b\\u4e94\\u5343\\u5e74&quot;, &quot;status&quot;: 1, &quot;fl&quot;: &quot;\\u5386\\u53f2&quot;}&#x27;<br/>headers = {&#x27;User-Agent&#x27;: &#x27;python-requests/2.32.4&#x27;, &#x27;Accept-Encoding&#x27;: &#x27;gzip, deflate&#x27;, &#x27;Accept&#x27;: &#x27;*/*&#x27;, &#x27;Connection&#x27;: &#x27;keep-alive&#x27;, &#x27;Content-Length&#x27;: &#x27;99&#x27;, &#x27;Content-Type&#x27;: &#x27;application/json&#x27;}<br/>retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)<br/>redirect = False, assert_same_host = False<br/>timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None<br/>release_conn = False, chunked = False, body_pos = None, preload_content = False<br/>decode_content = False, response_kw = {}<br/>parsed_url = Url(scheme=None, auth=None, host=None, port=None, path=&#x27;/editBook/4&#x27;, query=None, fragment=None)<br/>destination_scheme = None, conn = None, release_this_conn = True<br/>http_tunnel_required = False, err = None, clean_exit = False<br/><br/>    def urlopen(  # type: ignore[override]<br/>        self,<br/>        method: str,<br/>        url: str,<br/>        body: _TYPE_BODY | None = None,<br/>        headers: typing.Mapping[str, str] | None = None,<br/>        retries: Retry | bool | int | None = None,<br/>        redirect: bool = True,<br/>        assert_same_host: bool = True,<br/>        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,<br/>        pool_timeout: int | None = None,<br/>        release_conn: bool | None = None,<br/>        chunked: bool = False,<br/>        body_pos: _TYPE_BODY_POSITION | None = None,<br/>        preload_content: bool = True,<br/>        decode_content: bool = True,<br/>        **response_kw: typing.Any,<br/>    ) -&gt; BaseHTTPResponse:<br/>        &quot;&quot;&quot;<br/>        Get a connection from the pool and perform an HTTP request. This is the<br/>        lowest level call for making a request, so you&#x27;ll need to specify all<br/>        the raw details.<br/>    <br/>        .. note::<br/>    <br/>           More commonly, it&#x27;s appropriate to use a convenience method<br/>           such as :meth:`request`.<br/>    <br/>        .. note::<br/>    <br/>           `release_conn` will only behave as expected if<br/>           `preload_content=False` because we want to make<br/>           `preload_content=False` the default behaviour someday soon without<br/>           breaking backwards compatibility.<br/>    <br/>        :param method:<br/>            HTTP request method (such as GET, POST, PUT, etc.)<br/>    <br/>        :param url:<br/>            The URL to perform the request on.<br/>    <br/>        :param body:<br/>            Data to send in the request body, either :class:`str`, :class:`bytes`,<br/>            an iterable of :class:`str`/:class:`bytes`, or a file-like object.<br/>    <br/>        :param headers:<br/>            Dictionary of custom headers to send, such as User-Agent,<br/>            If-None-Match, etc. If None, pool headers are used. If provided,<br/>            these headers completely replace any pool-specific headers.<br/>    <br/>        :param retries:<br/>            Configure the number of retries to allow before raising a<br/>            :class:`~urllib3.exceptions.MaxRetryError` exception.<br/>    <br/>            If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a<br/>            :class:`~urllib3.util.retry.Retry` object for fine-grained control<br/>            over different types of retries.<br/>            Pass an integer number to retry connection errors that many times,<br/>            but no other types of errors. Pass zero to never retry.<br/>    <br/>            If ``False``, then retries are disabled and any exception is raised<br/>            immediately. Also, instead of raising a MaxRetryError on redirects,<br/>            the redirect response will be returned.<br/>    <br/>        :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.<br/>    <br/>        :param redirect:<br/>            If True, automatically handle redirects (status codes 301, 302,<br/>            303, 307, 308). Each redirect counts as a retry. Disabling retries<br/>            will disable redirect, too.<br/>    <br/>        :param assert_same_host:<br/>            If ``True``, will make sure that the host of the pool requests is<br/>            consistent else will raise HostChangedError. When ``False``, you can<br/>            use the pool on an HTTP proxy and request foreign hosts.<br/>    <br/>        :param timeout:<br/>            If specified, overrides the default timeout for this one<br/>            request. It may be a float (in seconds) or an instance of<br/>            :class:`urllib3.util.Timeout`.<br/>    <br/>        :param pool_timeout:<br/>            If set and the pool is set to block=True, then this method will<br/>            block for ``pool_timeout`` seconds and raise EmptyPoolError if no<br/>            connection is available within the time period.<br/>    <br/>        :param bool preload_content:<br/>            If True, the response&#x27;s body will be preloaded into memory.<br/>    <br/>        :param bool decode_content:<br/>            If True, will attempt to decode the body based on the<br/>            &#x27;content-encoding&#x27; header.<br/>    <br/>        :param release_conn:<br/>            If False, then the urlopen call will not release the connection<br/>            back into the pool once a response is received (but will release if<br/>            you read the entire contents of the response such as when<br/>            `preload_content=True`). This is useful if you&#x27;re not preloading<br/>            the response&#x27;s content immediately. You will need to call<br/>            ``r.release_conn()`` on the response ``r`` to return the connection<br/>            back into the pool. If None, it takes the value of ``preload_content``<br/>            which defaults to ``True``.<br/>    <br/>        :param bool chunked:<br/>            If True, urllib3 will send the body using chunked transfer<br/>            encoding. Otherwise, urllib3 will send the body using the standard<br/>            content-length form. Defaults to False.<br/>    <br/>        :param int body_pos:<br/>            Position to seek to in file-like body in the event of a retry or<br/>            redirect. Typically this won&#x27;t need to be set because urllib3 will<br/>            auto-populate the value when needed.<br/>        &quot;&quot;&quot;<br/>        parsed_url = parse_url(url)<br/>        destination_scheme = parsed_url.scheme<br/>    <br/>        if headers is None:<br/>            headers = self.headers<br/>    <br/>        if not isinstance(retries, Retry):<br/>            retries = Retry.from_int(retries, redirect=redirect, default=self.retries)<br/>    <br/>        if release_conn is None:<br/>            release_conn = preload_content<br/>    <br/>        # Check host<br/>        if assert_same_host and not self.is_same_host(url):<br/>            raise HostChangedError(self, url, retries)<br/>    <br/>        # Ensure that the URL we&#x27;re connecting to is properly encoded<br/>        if url.startswith(&quot;/&quot;):<br/>            url = to_str(_encode_target(url))<br/>        else:<br/>            url = to_str(parsed_url.url)<br/>    <br/>        conn = None<br/>    <br/>        # Track whether `conn` needs to be released before<br/>        # returning/raising/recursing. Update this variable if necessary, and<br/>        # leave `release_conn` constant throughout the function. That way, if<br/>        # the function recurses, the original value of `release_conn` will be<br/>        # passed down into the recursive call, and its value will be respected.<br/>        #<br/>        # See issue #651 [1] for details.<br/>        #<br/>        # [1] &lt;https://github.com/urllib3/urllib3/issues/651&gt;<br/>        release_this_conn = release_conn<br/>    <br/>        http_tunnel_required = connection_requires_http_tunnel(<br/>            self.proxy, self.proxy_config, destination_scheme<br/>        )<br/>    <br/>        # Merge the proxy headers. Only done when not using HTTP CONNECT. We<br/>        # have to copy the headers dict so we can safely change it without those<br/>        # changes being reflected in anyone else&#x27;s copy.<br/>        if not http_tunnel_required:<br/>            headers = headers.copy()  # type: ignore[attr-defined]<br/>            headers.update(self.proxy_headers)  # type: ignore[union-attr]<br/>    <br/>        # Must keep the exception bound to a separate variable or else Python 3<br/>        # complains about UnboundLocalError.<br/>        err = None<br/>    <br/>        # Keep track of whether we cleanly exited the except block. This<br/>        # ensures we do proper cleanup in finally.<br/>        clean_exit = False<br/>    <br/>        # Rewind body position, if needed. Record current position<br/>        # for future rewinds in the event of a redirect/retry.<br/>        body_pos = set_file_position(body, body_pos)<br/>    <br/>        try:<br/>            # Request a connection from the queue.<br/>            timeout_obj = self._get_timeout(timeout)<br/>            conn = self._get_conn(timeout=pool_timeout)<br/>    <br/>            conn.timeout = timeout_obj.connect_timeout  # type: ignore[assignment]<br/>    <br/>            # Is this a closed/new connection that requires CONNECT tunnelling?<br/>            if self.proxy is not None and http_tunnel_required and conn.is_closed:<br/>                try:<br/>                    self._prepare_proxy(conn)<br/>                except (BaseSSLError, OSError, SocketTimeout) as e:<br/>                    self._raise_timeout(<br/>                        err=e, url=self.proxy.url, timeout_value=conn.timeout<br/>                    )<br/>                    raise<br/>    <br/>            # If we&#x27;re going to release the connection in ``finally:``, then<br/>            # the response doesn&#x27;t need to know about the connection. Otherwise<br/>            # it will also try to release it and we&#x27;ll have a double-release<br/>            # mess.<br/>            response_conn = conn if not release_conn else None<br/>    <br/>            # Make the request on the HTTPConnection object<br/>&gt;           response = self._make_request(<br/>                conn,<br/>                method,<br/>                url,<br/>                timeout=timeout_obj,<br/>                body=body,<br/>                headers=headers,<br/>                chunked=chunked,<br/>                retries=retries,<br/>                response_conn=response_conn,<br/>                preload_content=preload_content,<br/>                decode_content=decode_content,<br/>                **response_kw,<br/>            )<br/><br/>.venv\lib\site-packages\urllib3\connectionpool.py:789: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\connectionpool.py:495: in _make_request<br/>    conn.request(<br/>.venv\lib\site-packages\urllib3\connection.py:441: in request<br/>    self.endheaders()<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:1225: in endheaders<br/>    self._send_output(message_body, encode_chunked=encode_chunked)<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:1004: in _send_output<br/>    self.send(msg)<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:944: in send<br/>    self.connect()<br/>.venv\lib\site-packages\urllib3\connection.py:279: in connect<br/>    self.sock = self._new_conn()<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = &lt;urllib3.connection.HTTPConnection object at 0x000001E26DF10370&gt;<br/><br/>    def _new_conn(self) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Establish a socket connection and set nodelay settings on it.<br/>    <br/>        :return: New socket connection.<br/>        &quot;&quot;&quot;<br/>        try:<br/>            sock = connection.create_connection(<br/>                (self._dns_host, self.port),<br/>                self.timeout,<br/>                source_address=self.source_address,<br/>                socket_options=self.socket_options,<br/>            )<br/>        except socket.gaierror as e:<br/>            raise NameResolutionError(self.host, self, e) from e<br/>        except SocketTimeout as e:<br/>            raise ConnectTimeoutError(<br/>                self,<br/>                f&quot;Connection to {self.host} timed out. (connect timeout={self.timeout})&quot;,<br/>            ) from e<br/>    <br/>        except OSError as e:<br/>&gt;           raise NewConnectionError(<br/>                self, f&quot;Failed to establish a new connection: {e}&quot;<br/>            ) from e<br/><span class="error">E           urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x000001E26DF10370&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。</span><br/><br/>.venv\lib\site-packages\urllib3\connection.py:214: NewConnectionError<br/><br/>The above exception was the direct cause of the following exception:<br/><br/>self = &lt;requests.adapters.HTTPAdapter object at 0x000001E26DEEC850&gt;<br/>request = &lt;PreparedRequest [PUT]&gt;, stream = False<br/>timeout = Timeout(connect=None, read=None, total=None), verify = True<br/>cert = None, proxies = OrderedDict()<br/><br/>    def send(<br/>        self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None<br/>    ):<br/>        &quot;&quot;&quot;Sends PreparedRequest object. Returns Response object.<br/>    <br/>        :param request: The :class:`PreparedRequest &lt;PreparedRequest&gt;` being sent.<br/>        :param stream: (optional) Whether to stream the request content.<br/>        :param timeout: (optional) How long to wait for the server to send<br/>            data before giving up, as a float, or a :ref:`(connect timeout,<br/>            read timeout) &lt;timeouts&gt;` tuple.<br/>        :type timeout: float or tuple or urllib3 Timeout object<br/>        :param verify: (optional) Either a boolean, in which case it controls whether<br/>            we verify the server&#x27;s TLS certificate, or a string, in which case it<br/>            must be a path to a CA bundle to use<br/>        :param cert: (optional) Any user-provided SSL certificate to be trusted.<br/>        :param proxies: (optional) The proxies dictionary to apply to the request.<br/>        :rtype: requests.Response<br/>        &quot;&quot;&quot;<br/>    <br/>        try:<br/>            conn = self.get_connection_with_tls_context(<br/>                request, verify, proxies=proxies, cert=cert<br/>            )<br/>        except LocationValueError as e:<br/>            raise InvalidURL(e, request=request)<br/>    <br/>        self.cert_verify(conn, request.url, verify, cert)<br/>        url = self.request_url(request, proxies)<br/>        self.add_headers(<br/>            request,<br/>            stream=stream,<br/>            timeout=timeout,<br/>            verify=verify,<br/>            cert=cert,<br/>            proxies=proxies,<br/>        )<br/>    <br/>        chunked = not (request.body is None or &quot;Content-Length&quot; in request.headers)<br/>    <br/>        if isinstance(timeout, tuple):<br/>            try:<br/>                connect, read = timeout<br/>                timeout = TimeoutSauce(connect=connect, read=read)<br/>            except ValueError:<br/>                raise ValueError(<br/>                    f&quot;Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, &quot;<br/>                    f&quot;or a single float to set both timeouts to the same value.&quot;<br/>                )<br/>        elif isinstance(timeout, TimeoutSauce):<br/>            pass<br/>        else:<br/>            timeout = TimeoutSauce(connect=timeout, read=timeout)<br/>    <br/>        try:<br/>&gt;           resp = conn.urlopen(<br/>                method=request.method,<br/>                url=url,<br/>                body=request.body,<br/>                headers=request.headers,<br/>                redirect=False,<br/>                assert_same_host=False,<br/>                preload_content=False,<br/>                decode_content=False,<br/>                retries=self.max_retries,<br/>                timeout=timeout,<br/>                chunked=chunked,<br/>            )<br/><br/>.venv\lib\site-packages\requests\adapters.py:667: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\connectionpool.py:843: in urlopen<br/>    retries = retries.increment(<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = Retry(total=0, connect=None, read=False, redirect=None, status=None)<br/>method = &#x27;PUT&#x27;, url = &#x27;/editBook/4&#x27;, response = None<br/>error = NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26DF10370&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;)<br/>_pool = &lt;urllib3.connectionpool.HTTPConnectionPool object at 0x000001E26DEECBB0&gt;<br/>_stacktrace = &lt;traceback object at 0x000001E26DF24180&gt;<br/><br/>    def increment(<br/>        self,<br/>        method: str | None = None,<br/>        url: str | None = None,<br/>        response: BaseHTTPResponse | None = None,<br/>        error: Exception | None = None,<br/>        _pool: ConnectionPool | None = None,<br/>        _stacktrace: TracebackType | None = None,<br/>    ) -&gt; Self:<br/>        &quot;&quot;&quot;Return a new Retry object with incremented retry counters.<br/>    <br/>        :param response: A response object, or None, if the server did not<br/>            return a response.<br/>        :type response: :class:`~urllib3.response.BaseHTTPResponse`<br/>        :param Exception error: An error encountered during the request, or<br/>            None if the response was received successfully.<br/>    <br/>        :return: A new ``Retry`` object.<br/>        &quot;&quot;&quot;<br/>        if self.total is False and error:<br/>            # Disabled, indicate to re-raise the error.<br/>            raise reraise(type(error), error, _stacktrace)<br/>    <br/>        total = self.total<br/>        if total is not None:<br/>            total -= 1<br/>    <br/>        connect = self.connect<br/>        read = self.read<br/>        redirect = self.redirect<br/>        status_count = self.status<br/>        other = self.other<br/>        cause = &quot;unknown&quot;<br/>        status = None<br/>        redirect_location = None<br/>    <br/>        if error and self._is_connection_error(error):<br/>            # Connect retry?<br/>            if connect is False:<br/>                raise reraise(type(error), error, _stacktrace)<br/>            elif connect is not None:<br/>                connect -= 1<br/>    <br/>        elif error and self._is_read_error(error):<br/>            # Read retry?<br/>            if read is False or method is None or not self._is_method_retryable(method):<br/>                raise reraise(type(error), error, _stacktrace)<br/>            elif read is not None:<br/>                read -= 1<br/>    <br/>        elif error:<br/>            # Other retry?<br/>            if other is not None:<br/>                other -= 1<br/>    <br/>        elif response and response.get_redirect_location():<br/>            # Redirect retry?<br/>            if redirect is not None:<br/>                redirect -= 1<br/>            cause = &quot;too many redirects&quot;<br/>            response_redirect_location = response.get_redirect_location()<br/>            if response_redirect_location:<br/>                redirect_location = response_redirect_location<br/>            status = response.status<br/>    <br/>        else:<br/>            # Incrementing because of a server error like a 500 in<br/>            # status_forcelist and the given method is in the allowed_methods<br/>            cause = ResponseError.GENERIC_ERROR<br/>            if response and response.status:<br/>                if status_count is not None:<br/>                    status_count -= 1<br/>                cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)<br/>                status = response.status<br/>    <br/>        history = self.history + (<br/>            RequestHistory(method, url, error, status, redirect_location),<br/>        )<br/>    <br/>        new_retry = self.new(<br/>            total=total,<br/>            connect=connect,<br/>            read=read,<br/>            redirect=redirect,<br/>            status=status_count,<br/>            other=other,<br/>            history=history,<br/>        )<br/>    <br/>        if new_retry.is_exhausted():<br/>            reason = error or ResponseError(cause)<br/>&gt;           raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]<br/><span class="error">E           urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#x27;127.0.0.1&#x27;, port=8000): Max retries exceeded with url: /editBook/4 (Caused by NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26DF10370&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;))</span><br/><br/>.venv\lib\site-packages\urllib3\util\retry.py:519: MaxRetryError<br/><br/>During handling of the above exception, another exception occurred:<br/><br/>self = &lt;conftest.TestGqzy1 object at 0x000001E26DED0EE0&gt;<br/>api_tool = &lt;Tool.tools.ApiRequestTool object at 0x000001E26DEEC520&gt;, id = 11<br/>book = &#x27;中华上下五千年&#x27;, status = 1, fl = &#x27;历史&#x27;<br/><br/>    @pytest.mark.parametrize(&quot;id,book,status,fl&quot;, get_yaml_data())<br/>    def test_put_putbook1(self,api_tool,id,book,status,fl):<br/>        print(&quot;\n==========修改图书===========&quot;)<br/>        putbook = {&quot;id&quot;: id, &quot;book&quot;: book, &quot;status&quot;: status, &quot;fl&quot;: fl}<br/>&gt;       status_code, response_text, response = api_tool.put(path=PUT_BOOK, json=putbook)<br/><br/>conftest\conftest.py:101: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>Tool\tools.py:24: in put<br/>    response = self.session.put(full_url,data=data,headers=head,json=json)<br/>.venv\lib\site-packages\requests\sessions.py:649: in put<br/>    return self.request(&quot;PUT&quot;, url, data=data, **kwargs)<br/>.venv\lib\site-packages\requests\sessions.py:589: in request<br/>    resp = self.send(prep, **send_kwargs)<br/>.venv\lib\site-packages\requests\sessions.py:703: in send<br/>    r = adapter.send(request, **kwargs)<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = &lt;requests.adapters.HTTPAdapter object at 0x000001E26DEEC850&gt;<br/>request = &lt;PreparedRequest [PUT]&gt;, stream = False<br/>timeout = Timeout(connect=None, read=None, total=None), verify = True<br/>cert = None, proxies = OrderedDict()<br/><br/>    def send(<br/>        self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None<br/>    ):<br/>        &quot;&quot;&quot;Sends PreparedRequest object. Returns Response object.<br/>    <br/>        :param request: The :class:`PreparedRequest &lt;PreparedRequest&gt;` being sent.<br/>        :param stream: (optional) Whether to stream the request content.<br/>        :param timeout: (optional) How long to wait for the server to send<br/>            data before giving up, as a float, or a :ref:`(connect timeout,<br/>            read timeout) &lt;timeouts&gt;` tuple.<br/>        :type timeout: float or tuple or urllib3 Timeout object<br/>        :param verify: (optional) Either a boolean, in which case it controls whether<br/>            we verify the server&#x27;s TLS certificate, or a string, in which case it<br/>            must be a path to a CA bundle to use<br/>        :param cert: (optional) Any user-provided SSL certificate to be trusted.<br/>        :param proxies: (optional) The proxies dictionary to apply to the request.<br/>        :rtype: requests.Response<br/>        &quot;&quot;&quot;<br/>    <br/>        try:<br/>            conn = self.get_connection_with_tls_context(<br/>                request, verify, proxies=proxies, cert=cert<br/>            )<br/>        except LocationValueError as e:<br/>            raise InvalidURL(e, request=request)<br/>    <br/>        self.cert_verify(conn, request.url, verify, cert)<br/>        url = self.request_url(request, proxies)<br/>        self.add_headers(<br/>            request,<br/>            stream=stream,<br/>            timeout=timeout,<br/>            verify=verify,<br/>            cert=cert,<br/>            proxies=proxies,<br/>        )<br/>    <br/>        chunked = not (request.body is None or &quot;Content-Length&quot; in request.headers)<br/>    <br/>        if isinstance(timeout, tuple):<br/>            try:<br/>                connect, read = timeout<br/>                timeout = TimeoutSauce(connect=connect, read=read)<br/>            except ValueError:<br/>                raise ValueError(<br/>                    f&quot;Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, &quot;<br/>                    f&quot;or a single float to set both timeouts to the same value.&quot;<br/>                )<br/>        elif isinstance(timeout, TimeoutSauce):<br/>            pass<br/>        else:<br/>            timeout = TimeoutSauce(connect=timeout, read=timeout)<br/>    <br/>        try:<br/>            resp = conn.urlopen(<br/>                method=request.method,<br/>                url=url,<br/>                body=request.body,<br/>                headers=request.headers,<br/>                redirect=False,<br/>                assert_same_host=False,<br/>                preload_content=False,<br/>                decode_content=False,<br/>                retries=self.max_retries,<br/>                timeout=timeout,<br/>                chunked=chunked,<br/>            )<br/>    <br/>        except (ProtocolError, OSError) as err:<br/>            raise ConnectionError(err, request=request)<br/>    <br/>        except MaxRetryError as e:<br/>            if isinstance(e.reason, ConnectTimeoutError):<br/>                # TODO: Remove this in 3.0.0: see #2811<br/>                if not isinstance(e.reason, NewConnectionError):<br/>                    raise ConnectTimeout(e, request=request)<br/>    <br/>            if isinstance(e.reason, ResponseError):<br/>                raise RetryError(e, request=request)<br/>    <br/>            if isinstance(e.reason, _ProxyError):<br/>                raise ProxyError(e, request=request)<br/>    <br/>            if isinstance(e.reason, _SSLError):<br/>                # This branch is for urllib3 v1.22 and later.<br/>                raise SSLError(e, request=request)<br/>    <br/>&gt;           raise ConnectionError(e, request=request)<br/><span class="error">E           requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#x27;127.0.0.1&#x27;, port=8000): Max retries exceeded with url: /editBook/4 (Caused by NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26DF10370&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;))</span><br/><br/>.venv\lib\site-packages\requests\adapters.py:700: ConnectionError<br/> ------------------------------Captured stdout call------------------------------ <br/>
==========修改图书===========
<br/></div></td></tr></tbody>
      <tbody class="failed results-table-row">
        <tr>
          <td class="col-result">Failed</td>
          <td class="col-name">conftest/conftest.py::TestGqzy1::test_put_putbook1[12-简爱-2-文学]</td>
          <td class="col-duration">2.05</td>
          <td class="col-links"></td></tr>
        <tr>
          <td class="extra" colspan="4">
            <div class="log">self = &lt;urllib3.connection.HTTPConnection object at 0x000001E26E47E700&gt;<br/><br/>    def _new_conn(self) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Establish a socket connection and set nodelay settings on it.<br/>    <br/>        :return: New socket connection.<br/>        &quot;&quot;&quot;<br/>        try:<br/>&gt;           sock = connection.create_connection(<br/>                (self._dns_host, self.port),<br/>                self.timeout,<br/>                source_address=self.source_address,<br/>                socket_options=self.socket_options,<br/>            )<br/><br/>.venv\lib\site-packages\urllib3\connection.py:199: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\util\connection.py:85: in create_connection<br/>    raise err<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>address = (&#x27;127.0.0.1&#x27;, 8000), timeout = None, source_address = None<br/>socket_options = [(6, 1, 1)]<br/><br/>    def create_connection(<br/>        address: tuple[str, int],<br/>        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,<br/>        source_address: tuple[str, int] | None = None,<br/>        socket_options: _TYPE_SOCKET_OPTIONS | None = None,<br/>    ) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Connect to *address* and return the socket object.<br/>    <br/>        Convenience function.  Connect to *address* (a 2-tuple ``(host,<br/>        port)``) and return the socket object.  Passing the optional<br/>        *timeout* parameter will set the timeout on the socket instance<br/>        before attempting to connect.  If no *timeout* is supplied, the<br/>        global default timeout setting returned by :func:`socket.getdefaulttimeout`<br/>        is used.  If *source_address* is set it must be a tuple of (host, port)<br/>        for the socket to bind as a source address before making the connection.<br/>        An host of &#x27;&#x27; or port 0 tells the OS to use the default.<br/>        &quot;&quot;&quot;<br/>    <br/>        host, port = address<br/>        if host.startswith(&quot;[&quot;):<br/>            host = host.strip(&quot;[]&quot;)<br/>        err = None<br/>    <br/>        # Using the value from allowed_gai_family() in the context of getaddrinfo lets<br/>        # us select whether to work with IPv4 DNS records, IPv6 records, or both.<br/>        # The original create_connection function always returns all records.<br/>        family = allowed_gai_family()<br/>    <br/>        try:<br/>            host.encode(&quot;idna&quot;)<br/>        except UnicodeError:<br/>            raise LocationParseError(f&quot;&#x27;{host}&#x27;, label empty or too long&quot;) from None<br/>    <br/>        for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):<br/>            af, socktype, proto, canonname, sa = res<br/>            sock = None<br/>            try:<br/>                sock = socket.socket(af, socktype, proto)<br/>    <br/>                # If provided, set socket level options before connecting.<br/>                _set_socket_options(sock, socket_options)<br/>    <br/>                if timeout is not _DEFAULT_TIMEOUT:<br/>                    sock.settimeout(timeout)<br/>                if source_address:<br/>                    sock.bind(source_address)<br/>&gt;               sock.connect(sa)<br/><span class="error">E               ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝，无法连接。</span><br/><br/>.venv\lib\site-packages\urllib3\util\connection.py:73: ConnectionRefusedError<br/><br/>The above exception was the direct cause of the following exception:<br/><br/>self = &lt;urllib3.connectionpool.HTTPConnectionPool object at 0x000001E26DEECBB0&gt;<br/>method = &#x27;PUT&#x27;, url = &#x27;/editBook/4&#x27;<br/>body = b&#x27;{&quot;id&quot;: 12, &quot;book&quot;: &quot;\\u7b80\\u7231&quot;, &quot;status&quot;: 2, &quot;fl&quot;: &quot;\\u6587\\u5b66&quot;}&#x27;<br/>headers = {&#x27;User-Agent&#x27;: &#x27;python-requests/2.32.4&#x27;, &#x27;Accept-Encoding&#x27;: &#x27;gzip, deflate&#x27;, &#x27;Accept&#x27;: &#x27;*/*&#x27;, &#x27;Connection&#x27;: &#x27;keep-alive&#x27;, &#x27;Content-Length&#x27;: &#x27;69&#x27;, &#x27;Content-Type&#x27;: &#x27;application/json&#x27;}<br/>retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)<br/>redirect = False, assert_same_host = False<br/>timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None<br/>release_conn = False, chunked = False, body_pos = None, preload_content = False<br/>decode_content = False, response_kw = {}<br/>parsed_url = Url(scheme=None, auth=None, host=None, port=None, path=&#x27;/editBook/4&#x27;, query=None, fragment=None)<br/>destination_scheme = None, conn = None, release_this_conn = True<br/>http_tunnel_required = False, err = None, clean_exit = False<br/><br/>    def urlopen(  # type: ignore[override]<br/>        self,<br/>        method: str,<br/>        url: str,<br/>        body: _TYPE_BODY | None = None,<br/>        headers: typing.Mapping[str, str] | None = None,<br/>        retries: Retry | bool | int | None = None,<br/>        redirect: bool = True,<br/>        assert_same_host: bool = True,<br/>        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,<br/>        pool_timeout: int | None = None,<br/>        release_conn: bool | None = None,<br/>        chunked: bool = False,<br/>        body_pos: _TYPE_BODY_POSITION | None = None,<br/>        preload_content: bool = True,<br/>        decode_content: bool = True,<br/>        **response_kw: typing.Any,<br/>    ) -&gt; BaseHTTPResponse:<br/>        &quot;&quot;&quot;<br/>        Get a connection from the pool and perform an HTTP request. This is the<br/>        lowest level call for making a request, so you&#x27;ll need to specify all<br/>        the raw details.<br/>    <br/>        .. note::<br/>    <br/>           More commonly, it&#x27;s appropriate to use a convenience method<br/>           such as :meth:`request`.<br/>    <br/>        .. note::<br/>    <br/>           `release_conn` will only behave as expected if<br/>           `preload_content=False` because we want to make<br/>           `preload_content=False` the default behaviour someday soon without<br/>           breaking backwards compatibility.<br/>    <br/>        :param method:<br/>            HTTP request method (such as GET, POST, PUT, etc.)<br/>    <br/>        :param url:<br/>            The URL to perform the request on.<br/>    <br/>        :param body:<br/>            Data to send in the request body, either :class:`str`, :class:`bytes`,<br/>            an iterable of :class:`str`/:class:`bytes`, or a file-like object.<br/>    <br/>        :param headers:<br/>            Dictionary of custom headers to send, such as User-Agent,<br/>            If-None-Match, etc. If None, pool headers are used. If provided,<br/>            these headers completely replace any pool-specific headers.<br/>    <br/>        :param retries:<br/>            Configure the number of retries to allow before raising a<br/>            :class:`~urllib3.exceptions.MaxRetryError` exception.<br/>    <br/>            If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a<br/>            :class:`~urllib3.util.retry.Retry` object for fine-grained control<br/>            over different types of retries.<br/>            Pass an integer number to retry connection errors that many times,<br/>            but no other types of errors. Pass zero to never retry.<br/>    <br/>            If ``False``, then retries are disabled and any exception is raised<br/>            immediately. Also, instead of raising a MaxRetryError on redirects,<br/>            the redirect response will be returned.<br/>    <br/>        :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.<br/>    <br/>        :param redirect:<br/>            If True, automatically handle redirects (status codes 301, 302,<br/>            303, 307, 308). Each redirect counts as a retry. Disabling retries<br/>            will disable redirect, too.<br/>    <br/>        :param assert_same_host:<br/>            If ``True``, will make sure that the host of the pool requests is<br/>            consistent else will raise HostChangedError. When ``False``, you can<br/>            use the pool on an HTTP proxy and request foreign hosts.<br/>    <br/>        :param timeout:<br/>            If specified, overrides the default timeout for this one<br/>            request. It may be a float (in seconds) or an instance of<br/>            :class:`urllib3.util.Timeout`.<br/>    <br/>        :param pool_timeout:<br/>            If set and the pool is set to block=True, then this method will<br/>            block for ``pool_timeout`` seconds and raise EmptyPoolError if no<br/>            connection is available within the time period.<br/>    <br/>        :param bool preload_content:<br/>            If True, the response&#x27;s body will be preloaded into memory.<br/>    <br/>        :param bool decode_content:<br/>            If True, will attempt to decode the body based on the<br/>            &#x27;content-encoding&#x27; header.<br/>    <br/>        :param release_conn:<br/>            If False, then the urlopen call will not release the connection<br/>            back into the pool once a response is received (but will release if<br/>            you read the entire contents of the response such as when<br/>            `preload_content=True`). This is useful if you&#x27;re not preloading<br/>            the response&#x27;s content immediately. You will need to call<br/>            ``r.release_conn()`` on the response ``r`` to return the connection<br/>            back into the pool. If None, it takes the value of ``preload_content``<br/>            which defaults to ``True``.<br/>    <br/>        :param bool chunked:<br/>            If True, urllib3 will send the body using chunked transfer<br/>            encoding. Otherwise, urllib3 will send the body using the standard<br/>            content-length form. Defaults to False.<br/>    <br/>        :param int body_pos:<br/>            Position to seek to in file-like body in the event of a retry or<br/>            redirect. Typically this won&#x27;t need to be set because urllib3 will<br/>            auto-populate the value when needed.<br/>        &quot;&quot;&quot;<br/>        parsed_url = parse_url(url)<br/>        destination_scheme = parsed_url.scheme<br/>    <br/>        if headers is None:<br/>            headers = self.headers<br/>    <br/>        if not isinstance(retries, Retry):<br/>            retries = Retry.from_int(retries, redirect=redirect, default=self.retries)<br/>    <br/>        if release_conn is None:<br/>            release_conn = preload_content<br/>    <br/>        # Check host<br/>        if assert_same_host and not self.is_same_host(url):<br/>            raise HostChangedError(self, url, retries)<br/>    <br/>        # Ensure that the URL we&#x27;re connecting to is properly encoded<br/>        if url.startswith(&quot;/&quot;):<br/>            url = to_str(_encode_target(url))<br/>        else:<br/>            url = to_str(parsed_url.url)<br/>    <br/>        conn = None<br/>    <br/>        # Track whether `conn` needs to be released before<br/>        # returning/raising/recursing. Update this variable if necessary, and<br/>        # leave `release_conn` constant throughout the function. That way, if<br/>        # the function recurses, the original value of `release_conn` will be<br/>        # passed down into the recursive call, and its value will be respected.<br/>        #<br/>        # See issue #651 [1] for details.<br/>        #<br/>        # [1] &lt;https://github.com/urllib3/urllib3/issues/651&gt;<br/>        release_this_conn = release_conn<br/>    <br/>        http_tunnel_required = connection_requires_http_tunnel(<br/>            self.proxy, self.proxy_config, destination_scheme<br/>        )<br/>    <br/>        # Merge the proxy headers. Only done when not using HTTP CONNECT. We<br/>        # have to copy the headers dict so we can safely change it without those<br/>        # changes being reflected in anyone else&#x27;s copy.<br/>        if not http_tunnel_required:<br/>            headers = headers.copy()  # type: ignore[attr-defined]<br/>            headers.update(self.proxy_headers)  # type: ignore[union-attr]<br/>    <br/>        # Must keep the exception bound to a separate variable or else Python 3<br/>        # complains about UnboundLocalError.<br/>        err = None<br/>    <br/>        # Keep track of whether we cleanly exited the except block. This<br/>        # ensures we do proper cleanup in finally.<br/>        clean_exit = False<br/>    <br/>        # Rewind body position, if needed. Record current position<br/>        # for future rewinds in the event of a redirect/retry.<br/>        body_pos = set_file_position(body, body_pos)<br/>    <br/>        try:<br/>            # Request a connection from the queue.<br/>            timeout_obj = self._get_timeout(timeout)<br/>            conn = self._get_conn(timeout=pool_timeout)<br/>    <br/>            conn.timeout = timeout_obj.connect_timeout  # type: ignore[assignment]<br/>    <br/>            # Is this a closed/new connection that requires CONNECT tunnelling?<br/>            if self.proxy is not None and http_tunnel_required and conn.is_closed:<br/>                try:<br/>                    self._prepare_proxy(conn)<br/>                except (BaseSSLError, OSError, SocketTimeout) as e:<br/>                    self._raise_timeout(<br/>                        err=e, url=self.proxy.url, timeout_value=conn.timeout<br/>                    )<br/>                    raise<br/>    <br/>            # If we&#x27;re going to release the connection in ``finally:``, then<br/>            # the response doesn&#x27;t need to know about the connection. Otherwise<br/>            # it will also try to release it and we&#x27;ll have a double-release<br/>            # mess.<br/>            response_conn = conn if not release_conn else None<br/>    <br/>            # Make the request on the HTTPConnection object<br/>&gt;           response = self._make_request(<br/>                conn,<br/>                method,<br/>                url,<br/>                timeout=timeout_obj,<br/>                body=body,<br/>                headers=headers,<br/>                chunked=chunked,<br/>                retries=retries,<br/>                response_conn=response_conn,<br/>                preload_content=preload_content,<br/>                decode_content=decode_content,<br/>                **response_kw,<br/>            )<br/><br/>.venv\lib\site-packages\urllib3\connectionpool.py:789: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\connectionpool.py:495: in _make_request<br/>    conn.request(<br/>.venv\lib\site-packages\urllib3\connection.py:441: in request<br/>    self.endheaders()<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:1225: in endheaders<br/>    self._send_output(message_body, encode_chunked=encode_chunked)<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:1004: in _send_output<br/>    self.send(msg)<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:944: in send<br/>    self.connect()<br/>.venv\lib\site-packages\urllib3\connection.py:279: in connect<br/>    self.sock = self._new_conn()<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = &lt;urllib3.connection.HTTPConnection object at 0x000001E26E47E700&gt;<br/><br/>    def _new_conn(self) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Establish a socket connection and set nodelay settings on it.<br/>    <br/>        :return: New socket connection.<br/>        &quot;&quot;&quot;<br/>        try:<br/>            sock = connection.create_connection(<br/>                (self._dns_host, self.port),<br/>                self.timeout,<br/>                source_address=self.source_address,<br/>                socket_options=self.socket_options,<br/>            )<br/>        except socket.gaierror as e:<br/>            raise NameResolutionError(self.host, self, e) from e<br/>        except SocketTimeout as e:<br/>            raise ConnectTimeoutError(<br/>                self,<br/>                f&quot;Connection to {self.host} timed out. (connect timeout={self.timeout})&quot;,<br/>            ) from e<br/>    <br/>        except OSError as e:<br/>&gt;           raise NewConnectionError(<br/>                self, f&quot;Failed to establish a new connection: {e}&quot;<br/>            ) from e<br/><span class="error">E           urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x000001E26E47E700&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。</span><br/><br/>.venv\lib\site-packages\urllib3\connection.py:214: NewConnectionError<br/><br/>The above exception was the direct cause of the following exception:<br/><br/>self = &lt;requests.adapters.HTTPAdapter object at 0x000001E26DEEC850&gt;<br/>request = &lt;PreparedRequest [PUT]&gt;, stream = False<br/>timeout = Timeout(connect=None, read=None, total=None), verify = True<br/>cert = None, proxies = OrderedDict()<br/><br/>    def send(<br/>        self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None<br/>    ):<br/>        &quot;&quot;&quot;Sends PreparedRequest object. Returns Response object.<br/>    <br/>        :param request: The :class:`PreparedRequest &lt;PreparedRequest&gt;` being sent.<br/>        :param stream: (optional) Whether to stream the request content.<br/>        :param timeout: (optional) How long to wait for the server to send<br/>            data before giving up, as a float, or a :ref:`(connect timeout,<br/>            read timeout) &lt;timeouts&gt;` tuple.<br/>        :type timeout: float or tuple or urllib3 Timeout object<br/>        :param verify: (optional) Either a boolean, in which case it controls whether<br/>            we verify the server&#x27;s TLS certificate, or a string, in which case it<br/>            must be a path to a CA bundle to use<br/>        :param cert: (optional) Any user-provided SSL certificate to be trusted.<br/>        :param proxies: (optional) The proxies dictionary to apply to the request.<br/>        :rtype: requests.Response<br/>        &quot;&quot;&quot;<br/>    <br/>        try:<br/>            conn = self.get_connection_with_tls_context(<br/>                request, verify, proxies=proxies, cert=cert<br/>            )<br/>        except LocationValueError as e:<br/>            raise InvalidURL(e, request=request)<br/>    <br/>        self.cert_verify(conn, request.url, verify, cert)<br/>        url = self.request_url(request, proxies)<br/>        self.add_headers(<br/>            request,<br/>            stream=stream,<br/>            timeout=timeout,<br/>            verify=verify,<br/>            cert=cert,<br/>            proxies=proxies,<br/>        )<br/>    <br/>        chunked = not (request.body is None or &quot;Content-Length&quot; in request.headers)<br/>    <br/>        if isinstance(timeout, tuple):<br/>            try:<br/>                connect, read = timeout<br/>                timeout = TimeoutSauce(connect=connect, read=read)<br/>            except ValueError:<br/>                raise ValueError(<br/>                    f&quot;Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, &quot;<br/>                    f&quot;or a single float to set both timeouts to the same value.&quot;<br/>                )<br/>        elif isinstance(timeout, TimeoutSauce):<br/>            pass<br/>        else:<br/>            timeout = TimeoutSauce(connect=timeout, read=timeout)<br/>    <br/>        try:<br/>&gt;           resp = conn.urlopen(<br/>                method=request.method,<br/>                url=url,<br/>                body=request.body,<br/>                headers=request.headers,<br/>                redirect=False,<br/>                assert_same_host=False,<br/>                preload_content=False,<br/>                decode_content=False,<br/>                retries=self.max_retries,<br/>                timeout=timeout,<br/>                chunked=chunked,<br/>            )<br/><br/>.venv\lib\site-packages\requests\adapters.py:667: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\connectionpool.py:843: in urlopen<br/>    retries = retries.increment(<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = Retry(total=0, connect=None, read=False, redirect=None, status=None)<br/>method = &#x27;PUT&#x27;, url = &#x27;/editBook/4&#x27;, response = None<br/>error = NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26E47E700&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;)<br/>_pool = &lt;urllib3.connectionpool.HTTPConnectionPool object at 0x000001E26DEECBB0&gt;<br/>_stacktrace = &lt;traceback object at 0x000001E26E216B40&gt;<br/><br/>    def increment(<br/>        self,<br/>        method: str | None = None,<br/>        url: str | None = None,<br/>        response: BaseHTTPResponse | None = None,<br/>        error: Exception | None = None,<br/>        _pool: ConnectionPool | None = None,<br/>        _stacktrace: TracebackType | None = None,<br/>    ) -&gt; Self:<br/>        &quot;&quot;&quot;Return a new Retry object with incremented retry counters.<br/>    <br/>        :param response: A response object, or None, if the server did not<br/>            return a response.<br/>        :type response: :class:`~urllib3.response.BaseHTTPResponse`<br/>        :param Exception error: An error encountered during the request, or<br/>            None if the response was received successfully.<br/>    <br/>        :return: A new ``Retry`` object.<br/>        &quot;&quot;&quot;<br/>        if self.total is False and error:<br/>            # Disabled, indicate to re-raise the error.<br/>            raise reraise(type(error), error, _stacktrace)<br/>    <br/>        total = self.total<br/>        if total is not None:<br/>            total -= 1<br/>    <br/>        connect = self.connect<br/>        read = self.read<br/>        redirect = self.redirect<br/>        status_count = self.status<br/>        other = self.other<br/>        cause = &quot;unknown&quot;<br/>        status = None<br/>        redirect_location = None<br/>    <br/>        if error and self._is_connection_error(error):<br/>            # Connect retry?<br/>            if connect is False:<br/>                raise reraise(type(error), error, _stacktrace)<br/>            elif connect is not None:<br/>                connect -= 1<br/>    <br/>        elif error and self._is_read_error(error):<br/>            # Read retry?<br/>            if read is False or method is None or not self._is_method_retryable(method):<br/>                raise reraise(type(error), error, _stacktrace)<br/>            elif read is not None:<br/>                read -= 1<br/>    <br/>        elif error:<br/>            # Other retry?<br/>            if other is not None:<br/>                other -= 1<br/>    <br/>        elif response and response.get_redirect_location():<br/>            # Redirect retry?<br/>            if redirect is not None:<br/>                redirect -= 1<br/>            cause = &quot;too many redirects&quot;<br/>            response_redirect_location = response.get_redirect_location()<br/>            if response_redirect_location:<br/>                redirect_location = response_redirect_location<br/>            status = response.status<br/>    <br/>        else:<br/>            # Incrementing because of a server error like a 500 in<br/>            # status_forcelist and the given method is in the allowed_methods<br/>            cause = ResponseError.GENERIC_ERROR<br/>            if response and response.status:<br/>                if status_count is not None:<br/>                    status_count -= 1<br/>                cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)<br/>                status = response.status<br/>    <br/>        history = self.history + (<br/>            RequestHistory(method, url, error, status, redirect_location),<br/>        )<br/>    <br/>        new_retry = self.new(<br/>            total=total,<br/>            connect=connect,<br/>            read=read,<br/>            redirect=redirect,<br/>            status=status_count,<br/>            other=other,<br/>            history=history,<br/>        )<br/>    <br/>        if new_retry.is_exhausted():<br/>            reason = error or ResponseError(cause)<br/>&gt;           raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]<br/><span class="error">E           urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#x27;127.0.0.1&#x27;, port=8000): Max retries exceeded with url: /editBook/4 (Caused by NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26E47E700&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;))</span><br/><br/>.venv\lib\site-packages\urllib3\util\retry.py:519: MaxRetryError<br/><br/>During handling of the above exception, another exception occurred:<br/><br/>self = &lt;conftest.TestGqzy1 object at 0x000001E26DEEC2E0&gt;<br/>api_tool = &lt;Tool.tools.ApiRequestTool object at 0x000001E26DEEC520&gt;, id = 12<br/>book = &#x27;简爱&#x27;, status = 2, fl = &#x27;文学&#x27;<br/><br/>    @pytest.mark.parametrize(&quot;id,book,status,fl&quot;, get_yaml_data())<br/>    def test_put_putbook1(self,api_tool,id,book,status,fl):<br/>        print(&quot;\n==========修改图书===========&quot;)<br/>        putbook = {&quot;id&quot;: id, &quot;book&quot;: book, &quot;status&quot;: status, &quot;fl&quot;: fl}<br/>&gt;       status_code, response_text, response = api_tool.put(path=PUT_BOOK, json=putbook)<br/><br/>conftest\conftest.py:101: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>Tool\tools.py:24: in put<br/>    response = self.session.put(full_url,data=data,headers=head,json=json)<br/>.venv\lib\site-packages\requests\sessions.py:649: in put<br/>    return self.request(&quot;PUT&quot;, url, data=data, **kwargs)<br/>.venv\lib\site-packages\requests\sessions.py:589: in request<br/>    resp = self.send(prep, **send_kwargs)<br/>.venv\lib\site-packages\requests\sessions.py:703: in send<br/>    r = adapter.send(request, **kwargs)<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = &lt;requests.adapters.HTTPAdapter object at 0x000001E26DEEC850&gt;<br/>request = &lt;PreparedRequest [PUT]&gt;, stream = False<br/>timeout = Timeout(connect=None, read=None, total=None), verify = True<br/>cert = None, proxies = OrderedDict()<br/><br/>    def send(<br/>        self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None<br/>    ):<br/>        &quot;&quot;&quot;Sends PreparedRequest object. Returns Response object.<br/>    <br/>        :param request: The :class:`PreparedRequest &lt;PreparedRequest&gt;` being sent.<br/>        :param stream: (optional) Whether to stream the request content.<br/>        :param timeout: (optional) How long to wait for the server to send<br/>            data before giving up, as a float, or a :ref:`(connect timeout,<br/>            read timeout) &lt;timeouts&gt;` tuple.<br/>        :type timeout: float or tuple or urllib3 Timeout object<br/>        :param verify: (optional) Either a boolean, in which case it controls whether<br/>            we verify the server&#x27;s TLS certificate, or a string, in which case it<br/>            must be a path to a CA bundle to use<br/>        :param cert: (optional) Any user-provided SSL certificate to be trusted.<br/>        :param proxies: (optional) The proxies dictionary to apply to the request.<br/>        :rtype: requests.Response<br/>        &quot;&quot;&quot;<br/>    <br/>        try:<br/>            conn = self.get_connection_with_tls_context(<br/>                request, verify, proxies=proxies, cert=cert<br/>            )<br/>        except LocationValueError as e:<br/>            raise InvalidURL(e, request=request)<br/>    <br/>        self.cert_verify(conn, request.url, verify, cert)<br/>        url = self.request_url(request, proxies)<br/>        self.add_headers(<br/>            request,<br/>            stream=stream,<br/>            timeout=timeout,<br/>            verify=verify,<br/>            cert=cert,<br/>            proxies=proxies,<br/>        )<br/>    <br/>        chunked = not (request.body is None or &quot;Content-Length&quot; in request.headers)<br/>    <br/>        if isinstance(timeout, tuple):<br/>            try:<br/>                connect, read = timeout<br/>                timeout = TimeoutSauce(connect=connect, read=read)<br/>            except ValueError:<br/>                raise ValueError(<br/>                    f&quot;Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, &quot;<br/>                    f&quot;or a single float to set both timeouts to the same value.&quot;<br/>                )<br/>        elif isinstance(timeout, TimeoutSauce):<br/>            pass<br/>        else:<br/>            timeout = TimeoutSauce(connect=timeout, read=timeout)<br/>    <br/>        try:<br/>            resp = conn.urlopen(<br/>                method=request.method,<br/>                url=url,<br/>                body=request.body,<br/>                headers=request.headers,<br/>                redirect=False,<br/>                assert_same_host=False,<br/>                preload_content=False,<br/>                decode_content=False,<br/>                retries=self.max_retries,<br/>                timeout=timeout,<br/>                chunked=chunked,<br/>            )<br/>    <br/>        except (ProtocolError, OSError) as err:<br/>            raise ConnectionError(err, request=request)<br/>    <br/>        except MaxRetryError as e:<br/>            if isinstance(e.reason, ConnectTimeoutError):<br/>                # TODO: Remove this in 3.0.0: see #2811<br/>                if not isinstance(e.reason, NewConnectionError):<br/>                    raise ConnectTimeout(e, request=request)<br/>    <br/>            if isinstance(e.reason, ResponseError):<br/>                raise RetryError(e, request=request)<br/>    <br/>            if isinstance(e.reason, _ProxyError):<br/>                raise ProxyError(e, request=request)<br/>    <br/>            if isinstance(e.reason, _SSLError):<br/>                # This branch is for urllib3 v1.22 and later.<br/>                raise SSLError(e, request=request)<br/>    <br/>&gt;           raise ConnectionError(e, request=request)<br/><span class="error">E           requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#x27;127.0.0.1&#x27;, port=8000): Max retries exceeded with url: /editBook/4 (Caused by NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26E47E700&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;))</span><br/><br/>.venv\lib\site-packages\requests\adapters.py:700: ConnectionError<br/> ------------------------------Captured stdout call------------------------------ <br/>
==========修改图书===========
<br/></div></td></tr></tbody>
      <tbody class="failed results-table-row">
        <tr>
          <td class="col-result">Failed</td>
          <td class="col-name">conftest/conftest.py::TestGqzy1::test_put_putbook1[13-水浒传-1-历史]</td>
          <td class="col-duration">2.04</td>
          <td class="col-links"></td></tr>
        <tr>
          <td class="extra" colspan="4">
            <div class="log">self = &lt;urllib3.connection.HTTPConnection object at 0x000001E26E46E4F0&gt;<br/><br/>    def _new_conn(self) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Establish a socket connection and set nodelay settings on it.<br/>    <br/>        :return: New socket connection.<br/>        &quot;&quot;&quot;<br/>        try:<br/>&gt;           sock = connection.create_connection(<br/>                (self._dns_host, self.port),<br/>                self.timeout,<br/>                source_address=self.source_address,<br/>                socket_options=self.socket_options,<br/>            )<br/><br/>.venv\lib\site-packages\urllib3\connection.py:199: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\util\connection.py:85: in create_connection<br/>    raise err<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>address = (&#x27;127.0.0.1&#x27;, 8000), timeout = None, source_address = None<br/>socket_options = [(6, 1, 1)]<br/><br/>    def create_connection(<br/>        address: tuple[str, int],<br/>        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,<br/>        source_address: tuple[str, int] | None = None,<br/>        socket_options: _TYPE_SOCKET_OPTIONS | None = None,<br/>    ) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Connect to *address* and return the socket object.<br/>    <br/>        Convenience function.  Connect to *address* (a 2-tuple ``(host,<br/>        port)``) and return the socket object.  Passing the optional<br/>        *timeout* parameter will set the timeout on the socket instance<br/>        before attempting to connect.  If no *timeout* is supplied, the<br/>        global default timeout setting returned by :func:`socket.getdefaulttimeout`<br/>        is used.  If *source_address* is set it must be a tuple of (host, port)<br/>        for the socket to bind as a source address before making the connection.<br/>        An host of &#x27;&#x27; or port 0 tells the OS to use the default.<br/>        &quot;&quot;&quot;<br/>    <br/>        host, port = address<br/>        if host.startswith(&quot;[&quot;):<br/>            host = host.strip(&quot;[]&quot;)<br/>        err = None<br/>    <br/>        # Using the value from allowed_gai_family() in the context of getaddrinfo lets<br/>        # us select whether to work with IPv4 DNS records, IPv6 records, or both.<br/>        # The original create_connection function always returns all records.<br/>        family = allowed_gai_family()<br/>    <br/>        try:<br/>            host.encode(&quot;idna&quot;)<br/>        except UnicodeError:<br/>            raise LocationParseError(f&quot;&#x27;{host}&#x27;, label empty or too long&quot;) from None<br/>    <br/>        for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):<br/>            af, socktype, proto, canonname, sa = res<br/>            sock = None<br/>            try:<br/>                sock = socket.socket(af, socktype, proto)<br/>    <br/>                # If provided, set socket level options before connecting.<br/>                _set_socket_options(sock, socket_options)<br/>    <br/>                if timeout is not _DEFAULT_TIMEOUT:<br/>                    sock.settimeout(timeout)<br/>                if source_address:<br/>                    sock.bind(source_address)<br/>&gt;               sock.connect(sa)<br/><span class="error">E               ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝，无法连接。</span><br/><br/>.venv\lib\site-packages\urllib3\util\connection.py:73: ConnectionRefusedError<br/><br/>The above exception was the direct cause of the following exception:<br/><br/>self = &lt;urllib3.connectionpool.HTTPConnectionPool object at 0x000001E26DEECBB0&gt;<br/>method = &#x27;PUT&#x27;, url = &#x27;/editBook/4&#x27;<br/>body = b&#x27;{&quot;id&quot;: 13, &quot;book&quot;: &quot;\\u6c34\\u6d52\\u4f20&quot;, &quot;status&quot;: 1, &quot;fl&quot;: &quot;\\u5386\\u53f2&quot;}&#x27;<br/>headers = {&#x27;User-Agent&#x27;: &#x27;python-requests/2.32.4&#x27;, &#x27;Accept-Encoding&#x27;: &#x27;gzip, deflate&#x27;, &#x27;Accept&#x27;: &#x27;*/*&#x27;, &#x27;Connection&#x27;: &#x27;keep-alive&#x27;, &#x27;Content-Length&#x27;: &#x27;75&#x27;, &#x27;Content-Type&#x27;: &#x27;application/json&#x27;}<br/>retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)<br/>redirect = False, assert_same_host = False<br/>timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None<br/>release_conn = False, chunked = False, body_pos = None, preload_content = False<br/>decode_content = False, response_kw = {}<br/>parsed_url = Url(scheme=None, auth=None, host=None, port=None, path=&#x27;/editBook/4&#x27;, query=None, fragment=None)<br/>destination_scheme = None, conn = None, release_this_conn = True<br/>http_tunnel_required = False, err = None, clean_exit = False<br/><br/>    def urlopen(  # type: ignore[override]<br/>        self,<br/>        method: str,<br/>        url: str,<br/>        body: _TYPE_BODY | None = None,<br/>        headers: typing.Mapping[str, str] | None = None,<br/>        retries: Retry | bool | int | None = None,<br/>        redirect: bool = True,<br/>        assert_same_host: bool = True,<br/>        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,<br/>        pool_timeout: int | None = None,<br/>        release_conn: bool | None = None,<br/>        chunked: bool = False,<br/>        body_pos: _TYPE_BODY_POSITION | None = None,<br/>        preload_content: bool = True,<br/>        decode_content: bool = True,<br/>        **response_kw: typing.Any,<br/>    ) -&gt; BaseHTTPResponse:<br/>        &quot;&quot;&quot;<br/>        Get a connection from the pool and perform an HTTP request. This is the<br/>        lowest level call for making a request, so you&#x27;ll need to specify all<br/>        the raw details.<br/>    <br/>        .. note::<br/>    <br/>           More commonly, it&#x27;s appropriate to use a convenience method<br/>           such as :meth:`request`.<br/>    <br/>        .. note::<br/>    <br/>           `release_conn` will only behave as expected if<br/>           `preload_content=False` because we want to make<br/>           `preload_content=False` the default behaviour someday soon without<br/>           breaking backwards compatibility.<br/>    <br/>        :param method:<br/>            HTTP request method (such as GET, POST, PUT, etc.)<br/>    <br/>        :param url:<br/>            The URL to perform the request on.<br/>    <br/>        :param body:<br/>            Data to send in the request body, either :class:`str`, :class:`bytes`,<br/>            an iterable of :class:`str`/:class:`bytes`, or a file-like object.<br/>    <br/>        :param headers:<br/>            Dictionary of custom headers to send, such as User-Agent,<br/>            If-None-Match, etc. If None, pool headers are used. If provided,<br/>            these headers completely replace any pool-specific headers.<br/>    <br/>        :param retries:<br/>            Configure the number of retries to allow before raising a<br/>            :class:`~urllib3.exceptions.MaxRetryError` exception.<br/>    <br/>            If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a<br/>            :class:`~urllib3.util.retry.Retry` object for fine-grained control<br/>            over different types of retries.<br/>            Pass an integer number to retry connection errors that many times,<br/>            but no other types of errors. Pass zero to never retry.<br/>    <br/>            If ``False``, then retries are disabled and any exception is raised<br/>            immediately. Also, instead of raising a MaxRetryError on redirects,<br/>            the redirect response will be returned.<br/>    <br/>        :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.<br/>    <br/>        :param redirect:<br/>            If True, automatically handle redirects (status codes 301, 302,<br/>            303, 307, 308). Each redirect counts as a retry. Disabling retries<br/>            will disable redirect, too.<br/>    <br/>        :param assert_same_host:<br/>            If ``True``, will make sure that the host of the pool requests is<br/>            consistent else will raise HostChangedError. When ``False``, you can<br/>            use the pool on an HTTP proxy and request foreign hosts.<br/>    <br/>        :param timeout:<br/>            If specified, overrides the default timeout for this one<br/>            request. It may be a float (in seconds) or an instance of<br/>            :class:`urllib3.util.Timeout`.<br/>    <br/>        :param pool_timeout:<br/>            If set and the pool is set to block=True, then this method will<br/>            block for ``pool_timeout`` seconds and raise EmptyPoolError if no<br/>            connection is available within the time period.<br/>    <br/>        :param bool preload_content:<br/>            If True, the response&#x27;s body will be preloaded into memory.<br/>    <br/>        :param bool decode_content:<br/>            If True, will attempt to decode the body based on the<br/>            &#x27;content-encoding&#x27; header.<br/>    <br/>        :param release_conn:<br/>            If False, then the urlopen call will not release the connection<br/>            back into the pool once a response is received (but will release if<br/>            you read the entire contents of the response such as when<br/>            `preload_content=True`). This is useful if you&#x27;re not preloading<br/>            the response&#x27;s content immediately. You will need to call<br/>            ``r.release_conn()`` on the response ``r`` to return the connection<br/>            back into the pool. If None, it takes the value of ``preload_content``<br/>            which defaults to ``True``.<br/>    <br/>        :param bool chunked:<br/>            If True, urllib3 will send the body using chunked transfer<br/>            encoding. Otherwise, urllib3 will send the body using the standard<br/>            content-length form. Defaults to False.<br/>    <br/>        :param int body_pos:<br/>            Position to seek to in file-like body in the event of a retry or<br/>            redirect. Typically this won&#x27;t need to be set because urllib3 will<br/>            auto-populate the value when needed.<br/>        &quot;&quot;&quot;<br/>        parsed_url = parse_url(url)<br/>        destination_scheme = parsed_url.scheme<br/>    <br/>        if headers is None:<br/>            headers = self.headers<br/>    <br/>        if not isinstance(retries, Retry):<br/>            retries = Retry.from_int(retries, redirect=redirect, default=self.retries)<br/>    <br/>        if release_conn is None:<br/>            release_conn = preload_content<br/>    <br/>        # Check host<br/>        if assert_same_host and not self.is_same_host(url):<br/>            raise HostChangedError(self, url, retries)<br/>    <br/>        # Ensure that the URL we&#x27;re connecting to is properly encoded<br/>        if url.startswith(&quot;/&quot;):<br/>            url = to_str(_encode_target(url))<br/>        else:<br/>            url = to_str(parsed_url.url)<br/>    <br/>        conn = None<br/>    <br/>        # Track whether `conn` needs to be released before<br/>        # returning/raising/recursing. Update this variable if necessary, and<br/>        # leave `release_conn` constant throughout the function. That way, if<br/>        # the function recurses, the original value of `release_conn` will be<br/>        # passed down into the recursive call, and its value will be respected.<br/>        #<br/>        # See issue #651 [1] for details.<br/>        #<br/>        # [1] &lt;https://github.com/urllib3/urllib3/issues/651&gt;<br/>        release_this_conn = release_conn<br/>    <br/>        http_tunnel_required = connection_requires_http_tunnel(<br/>            self.proxy, self.proxy_config, destination_scheme<br/>        )<br/>    <br/>        # Merge the proxy headers. Only done when not using HTTP CONNECT. We<br/>        # have to copy the headers dict so we can safely change it without those<br/>        # changes being reflected in anyone else&#x27;s copy.<br/>        if not http_tunnel_required:<br/>            headers = headers.copy()  # type: ignore[attr-defined]<br/>            headers.update(self.proxy_headers)  # type: ignore[union-attr]<br/>    <br/>        # Must keep the exception bound to a separate variable or else Python 3<br/>        # complains about UnboundLocalError.<br/>        err = None<br/>    <br/>        # Keep track of whether we cleanly exited the except block. This<br/>        # ensures we do proper cleanup in finally.<br/>        clean_exit = False<br/>    <br/>        # Rewind body position, if needed. Record current position<br/>        # for future rewinds in the event of a redirect/retry.<br/>        body_pos = set_file_position(body, body_pos)<br/>    <br/>        try:<br/>            # Request a connection from the queue.<br/>            timeout_obj = self._get_timeout(timeout)<br/>            conn = self._get_conn(timeout=pool_timeout)<br/>    <br/>            conn.timeout = timeout_obj.connect_timeout  # type: ignore[assignment]<br/>    <br/>            # Is this a closed/new connection that requires CONNECT tunnelling?<br/>            if self.proxy is not None and http_tunnel_required and conn.is_closed:<br/>                try:<br/>                    self._prepare_proxy(conn)<br/>                except (BaseSSLError, OSError, SocketTimeout) as e:<br/>                    self._raise_timeout(<br/>                        err=e, url=self.proxy.url, timeout_value=conn.timeout<br/>                    )<br/>                    raise<br/>    <br/>            # If we&#x27;re going to release the connection in ``finally:``, then<br/>            # the response doesn&#x27;t need to know about the connection. Otherwise<br/>            # it will also try to release it and we&#x27;ll have a double-release<br/>            # mess.<br/>            response_conn = conn if not release_conn else None<br/>    <br/>            # Make the request on the HTTPConnection object<br/>&gt;           response = self._make_request(<br/>                conn,<br/>                method,<br/>                url,<br/>                timeout=timeout_obj,<br/>                body=body,<br/>                headers=headers,<br/>                chunked=chunked,<br/>                retries=retries,<br/>                response_conn=response_conn,<br/>                preload_content=preload_content,<br/>                decode_content=decode_content,<br/>                **response_kw,<br/>            )<br/><br/>.venv\lib\site-packages\urllib3\connectionpool.py:789: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\connectionpool.py:495: in _make_request<br/>    conn.request(<br/>.venv\lib\site-packages\urllib3\connection.py:441: in request<br/>    self.endheaders()<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:1225: in endheaders<br/>    self._send_output(message_body, encode_chunked=encode_chunked)<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:1004: in _send_output<br/>    self.send(msg)<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:944: in send<br/>    self.connect()<br/>.venv\lib\site-packages\urllib3\connection.py:279: in connect<br/>    self.sock = self._new_conn()<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = &lt;urllib3.connection.HTTPConnection object at 0x000001E26E46E4F0&gt;<br/><br/>    def _new_conn(self) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Establish a socket connection and set nodelay settings on it.<br/>    <br/>        :return: New socket connection.<br/>        &quot;&quot;&quot;<br/>        try:<br/>            sock = connection.create_connection(<br/>                (self._dns_host, self.port),<br/>                self.timeout,<br/>                source_address=self.source_address,<br/>                socket_options=self.socket_options,<br/>            )<br/>        except socket.gaierror as e:<br/>            raise NameResolutionError(self.host, self, e) from e<br/>        except SocketTimeout as e:<br/>            raise ConnectTimeoutError(<br/>                self,<br/>                f&quot;Connection to {self.host} timed out. (connect timeout={self.timeout})&quot;,<br/>            ) from e<br/>    <br/>        except OSError as e:<br/>&gt;           raise NewConnectionError(<br/>                self, f&quot;Failed to establish a new connection: {e}&quot;<br/>            ) from e<br/><span class="error">E           urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x000001E26E46E4F0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。</span><br/><br/>.venv\lib\site-packages\urllib3\connection.py:214: NewConnectionError<br/><br/>The above exception was the direct cause of the following exception:<br/><br/>self = &lt;requests.adapters.HTTPAdapter object at 0x000001E26DEEC850&gt;<br/>request = &lt;PreparedRequest [PUT]&gt;, stream = False<br/>timeout = Timeout(connect=None, read=None, total=None), verify = True<br/>cert = None, proxies = OrderedDict()<br/><br/>    def send(<br/>        self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None<br/>    ):<br/>        &quot;&quot;&quot;Sends PreparedRequest object. Returns Response object.<br/>    <br/>        :param request: The :class:`PreparedRequest &lt;PreparedRequest&gt;` being sent.<br/>        :param stream: (optional) Whether to stream the request content.<br/>        :param timeout: (optional) How long to wait for the server to send<br/>            data before giving up, as a float, or a :ref:`(connect timeout,<br/>            read timeout) &lt;timeouts&gt;` tuple.<br/>        :type timeout: float or tuple or urllib3 Timeout object<br/>        :param verify: (optional) Either a boolean, in which case it controls whether<br/>            we verify the server&#x27;s TLS certificate, or a string, in which case it<br/>            must be a path to a CA bundle to use<br/>        :param cert: (optional) Any user-provided SSL certificate to be trusted.<br/>        :param proxies: (optional) The proxies dictionary to apply to the request.<br/>        :rtype: requests.Response<br/>        &quot;&quot;&quot;<br/>    <br/>        try:<br/>            conn = self.get_connection_with_tls_context(<br/>                request, verify, proxies=proxies, cert=cert<br/>            )<br/>        except LocationValueError as e:<br/>            raise InvalidURL(e, request=request)<br/>    <br/>        self.cert_verify(conn, request.url, verify, cert)<br/>        url = self.request_url(request, proxies)<br/>        self.add_headers(<br/>            request,<br/>            stream=stream,<br/>            timeout=timeout,<br/>            verify=verify,<br/>            cert=cert,<br/>            proxies=proxies,<br/>        )<br/>    <br/>        chunked = not (request.body is None or &quot;Content-Length&quot; in request.headers)<br/>    <br/>        if isinstance(timeout, tuple):<br/>            try:<br/>                connect, read = timeout<br/>                timeout = TimeoutSauce(connect=connect, read=read)<br/>            except ValueError:<br/>                raise ValueError(<br/>                    f&quot;Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, &quot;<br/>                    f&quot;or a single float to set both timeouts to the same value.&quot;<br/>                )<br/>        elif isinstance(timeout, TimeoutSauce):<br/>            pass<br/>        else:<br/>            timeout = TimeoutSauce(connect=timeout, read=timeout)<br/>    <br/>        try:<br/>&gt;           resp = conn.urlopen(<br/>                method=request.method,<br/>                url=url,<br/>                body=request.body,<br/>                headers=request.headers,<br/>                redirect=False,<br/>                assert_same_host=False,<br/>                preload_content=False,<br/>                decode_content=False,<br/>                retries=self.max_retries,<br/>                timeout=timeout,<br/>                chunked=chunked,<br/>            )<br/><br/>.venv\lib\site-packages\requests\adapters.py:667: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\connectionpool.py:843: in urlopen<br/>    retries = retries.increment(<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = Retry(total=0, connect=None, read=False, redirect=None, status=None)<br/>method = &#x27;PUT&#x27;, url = &#x27;/editBook/4&#x27;, response = None<br/>error = NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26E46E4F0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;)<br/>_pool = &lt;urllib3.connectionpool.HTTPConnectionPool object at 0x000001E26DEECBB0&gt;<br/>_stacktrace = &lt;traceback object at 0x000001E26E244B80&gt;<br/><br/>    def increment(<br/>        self,<br/>        method: str | None = None,<br/>        url: str | None = None,<br/>        response: BaseHTTPResponse | None = None,<br/>        error: Exception | None = None,<br/>        _pool: ConnectionPool | None = None,<br/>        _stacktrace: TracebackType | None = None,<br/>    ) -&gt; Self:<br/>        &quot;&quot;&quot;Return a new Retry object with incremented retry counters.<br/>    <br/>        :param response: A response object, or None, if the server did not<br/>            return a response.<br/>        :type response: :class:`~urllib3.response.BaseHTTPResponse`<br/>        :param Exception error: An error encountered during the request, or<br/>            None if the response was received successfully.<br/>    <br/>        :return: A new ``Retry`` object.<br/>        &quot;&quot;&quot;<br/>        if self.total is False and error:<br/>            # Disabled, indicate to re-raise the error.<br/>            raise reraise(type(error), error, _stacktrace)<br/>    <br/>        total = self.total<br/>        if total is not None:<br/>            total -= 1<br/>    <br/>        connect = self.connect<br/>        read = self.read<br/>        redirect = self.redirect<br/>        status_count = self.status<br/>        other = self.other<br/>        cause = &quot;unknown&quot;<br/>        status = None<br/>        redirect_location = None<br/>    <br/>        if error and self._is_connection_error(error):<br/>            # Connect retry?<br/>            if connect is False:<br/>                raise reraise(type(error), error, _stacktrace)<br/>            elif connect is not None:<br/>                connect -= 1<br/>    <br/>        elif error and self._is_read_error(error):<br/>            # Read retry?<br/>            if read is False or method is None or not self._is_method_retryable(method):<br/>                raise reraise(type(error), error, _stacktrace)<br/>            elif read is not None:<br/>                read -= 1<br/>    <br/>        elif error:<br/>            # Other retry?<br/>            if other is not None:<br/>                other -= 1<br/>    <br/>        elif response and response.get_redirect_location():<br/>            # Redirect retry?<br/>            if redirect is not None:<br/>                redirect -= 1<br/>            cause = &quot;too many redirects&quot;<br/>            response_redirect_location = response.get_redirect_location()<br/>            if response_redirect_location:<br/>                redirect_location = response_redirect_location<br/>            status = response.status<br/>    <br/>        else:<br/>            # Incrementing because of a server error like a 500 in<br/>            # status_forcelist and the given method is in the allowed_methods<br/>            cause = ResponseError.GENERIC_ERROR<br/>            if response and response.status:<br/>                if status_count is not None:<br/>                    status_count -= 1<br/>                cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)<br/>                status = response.status<br/>    <br/>        history = self.history + (<br/>            RequestHistory(method, url, error, status, redirect_location),<br/>        )<br/>    <br/>        new_retry = self.new(<br/>            total=total,<br/>            connect=connect,<br/>            read=read,<br/>            redirect=redirect,<br/>            status=status_count,<br/>            other=other,<br/>            history=history,<br/>        )<br/>    <br/>        if new_retry.is_exhausted():<br/>            reason = error or ResponseError(cause)<br/>&gt;           raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]<br/><span class="error">E           urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#x27;127.0.0.1&#x27;, port=8000): Max retries exceeded with url: /editBook/4 (Caused by NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26E46E4F0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;))</span><br/><br/>.venv\lib\site-packages\urllib3\util\retry.py:519: MaxRetryError<br/><br/>During handling of the above exception, another exception occurred:<br/><br/>self = &lt;conftest.TestGqzy1 object at 0x000001E26DEEC3A0&gt;<br/>api_tool = &lt;Tool.tools.ApiRequestTool object at 0x000001E26DEEC520&gt;, id = 13<br/>book = &#x27;水浒传&#x27;, status = 1, fl = &#x27;历史&#x27;<br/><br/>    @pytest.mark.parametrize(&quot;id,book,status,fl&quot;, get_yaml_data())<br/>    def test_put_putbook1(self,api_tool,id,book,status,fl):<br/>        print(&quot;\n==========修改图书===========&quot;)<br/>        putbook = {&quot;id&quot;: id, &quot;book&quot;: book, &quot;status&quot;: status, &quot;fl&quot;: fl}<br/>&gt;       status_code, response_text, response = api_tool.put(path=PUT_BOOK, json=putbook)<br/><br/>conftest\conftest.py:101: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>Tool\tools.py:24: in put<br/>    response = self.session.put(full_url,data=data,headers=head,json=json)<br/>.venv\lib\site-packages\requests\sessions.py:649: in put<br/>    return self.request(&quot;PUT&quot;, url, data=data, **kwargs)<br/>.venv\lib\site-packages\requests\sessions.py:589: in request<br/>    resp = self.send(prep, **send_kwargs)<br/>.venv\lib\site-packages\requests\sessions.py:703: in send<br/>    r = adapter.send(request, **kwargs)<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = &lt;requests.adapters.HTTPAdapter object at 0x000001E26DEEC850&gt;<br/>request = &lt;PreparedRequest [PUT]&gt;, stream = False<br/>timeout = Timeout(connect=None, read=None, total=None), verify = True<br/>cert = None, proxies = OrderedDict()<br/><br/>    def send(<br/>        self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None<br/>    ):<br/>        &quot;&quot;&quot;Sends PreparedRequest object. Returns Response object.<br/>    <br/>        :param request: The :class:`PreparedRequest &lt;PreparedRequest&gt;` being sent.<br/>        :param stream: (optional) Whether to stream the request content.<br/>        :param timeout: (optional) How long to wait for the server to send<br/>            data before giving up, as a float, or a :ref:`(connect timeout,<br/>            read timeout) &lt;timeouts&gt;` tuple.<br/>        :type timeout: float or tuple or urllib3 Timeout object<br/>        :param verify: (optional) Either a boolean, in which case it controls whether<br/>            we verify the server&#x27;s TLS certificate, or a string, in which case it<br/>            must be a path to a CA bundle to use<br/>        :param cert: (optional) Any user-provided SSL certificate to be trusted.<br/>        :param proxies: (optional) The proxies dictionary to apply to the request.<br/>        :rtype: requests.Response<br/>        &quot;&quot;&quot;<br/>    <br/>        try:<br/>            conn = self.get_connection_with_tls_context(<br/>                request, verify, proxies=proxies, cert=cert<br/>            )<br/>        except LocationValueError as e:<br/>            raise InvalidURL(e, request=request)<br/>    <br/>        self.cert_verify(conn, request.url, verify, cert)<br/>        url = self.request_url(request, proxies)<br/>        self.add_headers(<br/>            request,<br/>            stream=stream,<br/>            timeout=timeout,<br/>            verify=verify,<br/>            cert=cert,<br/>            proxies=proxies,<br/>        )<br/>    <br/>        chunked = not (request.body is None or &quot;Content-Length&quot; in request.headers)<br/>    <br/>        if isinstance(timeout, tuple):<br/>            try:<br/>                connect, read = timeout<br/>                timeout = TimeoutSauce(connect=connect, read=read)<br/>            except ValueError:<br/>                raise ValueError(<br/>                    f&quot;Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, &quot;<br/>                    f&quot;or a single float to set both timeouts to the same value.&quot;<br/>                )<br/>        elif isinstance(timeout, TimeoutSauce):<br/>            pass<br/>        else:<br/>            timeout = TimeoutSauce(connect=timeout, read=timeout)<br/>    <br/>        try:<br/>            resp = conn.urlopen(<br/>                method=request.method,<br/>                url=url,<br/>                body=request.body,<br/>                headers=request.headers,<br/>                redirect=False,<br/>                assert_same_host=False,<br/>                preload_content=False,<br/>                decode_content=False,<br/>                retries=self.max_retries,<br/>                timeout=timeout,<br/>                chunked=chunked,<br/>            )<br/>    <br/>        except (ProtocolError, OSError) as err:<br/>            raise ConnectionError(err, request=request)<br/>    <br/>        except MaxRetryError as e:<br/>            if isinstance(e.reason, ConnectTimeoutError):<br/>                # TODO: Remove this in 3.0.0: see #2811<br/>                if not isinstance(e.reason, NewConnectionError):<br/>                    raise ConnectTimeout(e, request=request)<br/>    <br/>            if isinstance(e.reason, ResponseError):<br/>                raise RetryError(e, request=request)<br/>    <br/>            if isinstance(e.reason, _ProxyError):<br/>                raise ProxyError(e, request=request)<br/>    <br/>            if isinstance(e.reason, _SSLError):<br/>                # This branch is for urllib3 v1.22 and later.<br/>                raise SSLError(e, request=request)<br/>    <br/>&gt;           raise ConnectionError(e, request=request)<br/><span class="error">E           requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#x27;127.0.0.1&#x27;, port=8000): Max retries exceeded with url: /editBook/4 (Caused by NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26E46E4F0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;))</span><br/><br/>.venv\lib\site-packages\requests\adapters.py:700: ConnectionError<br/> ------------------------------Captured stdout call------------------------------ <br/>
==========修改图书===========
<br/></div></td></tr></tbody>
      <tbody class="failed results-table-row">
        <tr>
          <td class="col-result">Failed</td>
          <td class="col-name">conftest/conftest.py::TestGqzy1::test_put_putbook1[14-红楼梦-1-历史]</td>
          <td class="col-duration">2.03</td>
          <td class="col-links"></td></tr>
        <tr>
          <td class="extra" colspan="4">
            <div class="log">self = &lt;urllib3.connection.HTTPConnection object at 0x000001E26E2880D0&gt;<br/><br/>    def _new_conn(self) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Establish a socket connection and set nodelay settings on it.<br/>    <br/>        :return: New socket connection.<br/>        &quot;&quot;&quot;<br/>        try:<br/>&gt;           sock = connection.create_connection(<br/>                (self._dns_host, self.port),<br/>                self.timeout,<br/>                source_address=self.source_address,<br/>                socket_options=self.socket_options,<br/>            )<br/><br/>.venv\lib\site-packages\urllib3\connection.py:199: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\util\connection.py:85: in create_connection<br/>    raise err<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>address = (&#x27;127.0.0.1&#x27;, 8000), timeout = None, source_address = None<br/>socket_options = [(6, 1, 1)]<br/><br/>    def create_connection(<br/>        address: tuple[str, int],<br/>        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,<br/>        source_address: tuple[str, int] | None = None,<br/>        socket_options: _TYPE_SOCKET_OPTIONS | None = None,<br/>    ) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Connect to *address* and return the socket object.<br/>    <br/>        Convenience function.  Connect to *address* (a 2-tuple ``(host,<br/>        port)``) and return the socket object.  Passing the optional<br/>        *timeout* parameter will set the timeout on the socket instance<br/>        before attempting to connect.  If no *timeout* is supplied, the<br/>        global default timeout setting returned by :func:`socket.getdefaulttimeout`<br/>        is used.  If *source_address* is set it must be a tuple of (host, port)<br/>        for the socket to bind as a source address before making the connection.<br/>        An host of &#x27;&#x27; or port 0 tells the OS to use the default.<br/>        &quot;&quot;&quot;<br/>    <br/>        host, port = address<br/>        if host.startswith(&quot;[&quot;):<br/>            host = host.strip(&quot;[]&quot;)<br/>        err = None<br/>    <br/>        # Using the value from allowed_gai_family() in the context of getaddrinfo lets<br/>        # us select whether to work with IPv4 DNS records, IPv6 records, or both.<br/>        # The original create_connection function always returns all records.<br/>        family = allowed_gai_family()<br/>    <br/>        try:<br/>            host.encode(&quot;idna&quot;)<br/>        except UnicodeError:<br/>            raise LocationParseError(f&quot;&#x27;{host}&#x27;, label empty or too long&quot;) from None<br/>    <br/>        for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):<br/>            af, socktype, proto, canonname, sa = res<br/>            sock = None<br/>            try:<br/>                sock = socket.socket(af, socktype, proto)<br/>    <br/>                # If provided, set socket level options before connecting.<br/>                _set_socket_options(sock, socket_options)<br/>    <br/>                if timeout is not _DEFAULT_TIMEOUT:<br/>                    sock.settimeout(timeout)<br/>                if source_address:<br/>                    sock.bind(source_address)<br/>&gt;               sock.connect(sa)<br/><span class="error">E               ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝，无法连接。</span><br/><br/>.venv\lib\site-packages\urllib3\util\connection.py:73: ConnectionRefusedError<br/><br/>The above exception was the direct cause of the following exception:<br/><br/>self = &lt;urllib3.connectionpool.HTTPConnectionPool object at 0x000001E26DEECBB0&gt;<br/>method = &#x27;PUT&#x27;, url = &#x27;/editBook/4&#x27;<br/>body = b&#x27;{&quot;id&quot;: 14, &quot;book&quot;: &quot;\\u7ea2\\u697c\\u68a6&quot;, &quot;status&quot;: 1, &quot;fl&quot;: &quot;\\u5386\\u53f2&quot;}&#x27;<br/>headers = {&#x27;User-Agent&#x27;: &#x27;python-requests/2.32.4&#x27;, &#x27;Accept-Encoding&#x27;: &#x27;gzip, deflate&#x27;, &#x27;Accept&#x27;: &#x27;*/*&#x27;, &#x27;Connection&#x27;: &#x27;keep-alive&#x27;, &#x27;Content-Length&#x27;: &#x27;75&#x27;, &#x27;Content-Type&#x27;: &#x27;application/json&#x27;}<br/>retries = Retry(total=0, connect=None, read=False, redirect=None, status=None)<br/>redirect = False, assert_same_host = False<br/>timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None<br/>release_conn = False, chunked = False, body_pos = None, preload_content = False<br/>decode_content = False, response_kw = {}<br/>parsed_url = Url(scheme=None, auth=None, host=None, port=None, path=&#x27;/editBook/4&#x27;, query=None, fragment=None)<br/>destination_scheme = None, conn = None, release_this_conn = True<br/>http_tunnel_required = False, err = None, clean_exit = False<br/><br/>    def urlopen(  # type: ignore[override]<br/>        self,<br/>        method: str,<br/>        url: str,<br/>        body: _TYPE_BODY | None = None,<br/>        headers: typing.Mapping[str, str] | None = None,<br/>        retries: Retry | bool | int | None = None,<br/>        redirect: bool = True,<br/>        assert_same_host: bool = True,<br/>        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,<br/>        pool_timeout: int | None = None,<br/>        release_conn: bool | None = None,<br/>        chunked: bool = False,<br/>        body_pos: _TYPE_BODY_POSITION | None = None,<br/>        preload_content: bool = True,<br/>        decode_content: bool = True,<br/>        **response_kw: typing.Any,<br/>    ) -&gt; BaseHTTPResponse:<br/>        &quot;&quot;&quot;<br/>        Get a connection from the pool and perform an HTTP request. This is the<br/>        lowest level call for making a request, so you&#x27;ll need to specify all<br/>        the raw details.<br/>    <br/>        .. note::<br/>    <br/>           More commonly, it&#x27;s appropriate to use a convenience method<br/>           such as :meth:`request`.<br/>    <br/>        .. note::<br/>    <br/>           `release_conn` will only behave as expected if<br/>           `preload_content=False` because we want to make<br/>           `preload_content=False` the default behaviour someday soon without<br/>           breaking backwards compatibility.<br/>    <br/>        :param method:<br/>            HTTP request method (such as GET, POST, PUT, etc.)<br/>    <br/>        :param url:<br/>            The URL to perform the request on.<br/>    <br/>        :param body:<br/>            Data to send in the request body, either :class:`str`, :class:`bytes`,<br/>            an iterable of :class:`str`/:class:`bytes`, or a file-like object.<br/>    <br/>        :param headers:<br/>            Dictionary of custom headers to send, such as User-Agent,<br/>            If-None-Match, etc. If None, pool headers are used. If provided,<br/>            these headers completely replace any pool-specific headers.<br/>    <br/>        :param retries:<br/>            Configure the number of retries to allow before raising a<br/>            :class:`~urllib3.exceptions.MaxRetryError` exception.<br/>    <br/>            If ``None`` (default) will retry 3 times, see ``Retry.DEFAULT``. Pass a<br/>            :class:`~urllib3.util.retry.Retry` object for fine-grained control<br/>            over different types of retries.<br/>            Pass an integer number to retry connection errors that many times,<br/>            but no other types of errors. Pass zero to never retry.<br/>    <br/>            If ``False``, then retries are disabled and any exception is raised<br/>            immediately. Also, instead of raising a MaxRetryError on redirects,<br/>            the redirect response will be returned.<br/>    <br/>        :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int.<br/>    <br/>        :param redirect:<br/>            If True, automatically handle redirects (status codes 301, 302,<br/>            303, 307, 308). Each redirect counts as a retry. Disabling retries<br/>            will disable redirect, too.<br/>    <br/>        :param assert_same_host:<br/>            If ``True``, will make sure that the host of the pool requests is<br/>            consistent else will raise HostChangedError. When ``False``, you can<br/>            use the pool on an HTTP proxy and request foreign hosts.<br/>    <br/>        :param timeout:<br/>            If specified, overrides the default timeout for this one<br/>            request. It may be a float (in seconds) or an instance of<br/>            :class:`urllib3.util.Timeout`.<br/>    <br/>        :param pool_timeout:<br/>            If set and the pool is set to block=True, then this method will<br/>            block for ``pool_timeout`` seconds and raise EmptyPoolError if no<br/>            connection is available within the time period.<br/>    <br/>        :param bool preload_content:<br/>            If True, the response&#x27;s body will be preloaded into memory.<br/>    <br/>        :param bool decode_content:<br/>            If True, will attempt to decode the body based on the<br/>            &#x27;content-encoding&#x27; header.<br/>    <br/>        :param release_conn:<br/>            If False, then the urlopen call will not release the connection<br/>            back into the pool once a response is received (but will release if<br/>            you read the entire contents of the response such as when<br/>            `preload_content=True`). This is useful if you&#x27;re not preloading<br/>            the response&#x27;s content immediately. You will need to call<br/>            ``r.release_conn()`` on the response ``r`` to return the connection<br/>            back into the pool. If None, it takes the value of ``preload_content``<br/>            which defaults to ``True``.<br/>    <br/>        :param bool chunked:<br/>            If True, urllib3 will send the body using chunked transfer<br/>            encoding. Otherwise, urllib3 will send the body using the standard<br/>            content-length form. Defaults to False.<br/>    <br/>        :param int body_pos:<br/>            Position to seek to in file-like body in the event of a retry or<br/>            redirect. Typically this won&#x27;t need to be set because urllib3 will<br/>            auto-populate the value when needed.<br/>        &quot;&quot;&quot;<br/>        parsed_url = parse_url(url)<br/>        destination_scheme = parsed_url.scheme<br/>    <br/>        if headers is None:<br/>            headers = self.headers<br/>    <br/>        if not isinstance(retries, Retry):<br/>            retries = Retry.from_int(retries, redirect=redirect, default=self.retries)<br/>    <br/>        if release_conn is None:<br/>            release_conn = preload_content<br/>    <br/>        # Check host<br/>        if assert_same_host and not self.is_same_host(url):<br/>            raise HostChangedError(self, url, retries)<br/>    <br/>        # Ensure that the URL we&#x27;re connecting to is properly encoded<br/>        if url.startswith(&quot;/&quot;):<br/>            url = to_str(_encode_target(url))<br/>        else:<br/>            url = to_str(parsed_url.url)<br/>    <br/>        conn = None<br/>    <br/>        # Track whether `conn` needs to be released before<br/>        # returning/raising/recursing. Update this variable if necessary, and<br/>        # leave `release_conn` constant throughout the function. That way, if<br/>        # the function recurses, the original value of `release_conn` will be<br/>        # passed down into the recursive call, and its value will be respected.<br/>        #<br/>        # See issue #651 [1] for details.<br/>        #<br/>        # [1] &lt;https://github.com/urllib3/urllib3/issues/651&gt;<br/>        release_this_conn = release_conn<br/>    <br/>        http_tunnel_required = connection_requires_http_tunnel(<br/>            self.proxy, self.proxy_config, destination_scheme<br/>        )<br/>    <br/>        # Merge the proxy headers. Only done when not using HTTP CONNECT. We<br/>        # have to copy the headers dict so we can safely change it without those<br/>        # changes being reflected in anyone else&#x27;s copy.<br/>        if not http_tunnel_required:<br/>            headers = headers.copy()  # type: ignore[attr-defined]<br/>            headers.update(self.proxy_headers)  # type: ignore[union-attr]<br/>    <br/>        # Must keep the exception bound to a separate variable or else Python 3<br/>        # complains about UnboundLocalError.<br/>        err = None<br/>    <br/>        # Keep track of whether we cleanly exited the except block. This<br/>        # ensures we do proper cleanup in finally.<br/>        clean_exit = False<br/>    <br/>        # Rewind body position, if needed. Record current position<br/>        # for future rewinds in the event of a redirect/retry.<br/>        body_pos = set_file_position(body, body_pos)<br/>    <br/>        try:<br/>            # Request a connection from the queue.<br/>            timeout_obj = self._get_timeout(timeout)<br/>            conn = self._get_conn(timeout=pool_timeout)<br/>    <br/>            conn.timeout = timeout_obj.connect_timeout  # type: ignore[assignment]<br/>    <br/>            # Is this a closed/new connection that requires CONNECT tunnelling?<br/>            if self.proxy is not None and http_tunnel_required and conn.is_closed:<br/>                try:<br/>                    self._prepare_proxy(conn)<br/>                except (BaseSSLError, OSError, SocketTimeout) as e:<br/>                    self._raise_timeout(<br/>                        err=e, url=self.proxy.url, timeout_value=conn.timeout<br/>                    )<br/>                    raise<br/>    <br/>            # If we&#x27;re going to release the connection in ``finally:``, then<br/>            # the response doesn&#x27;t need to know about the connection. Otherwise<br/>            # it will also try to release it and we&#x27;ll have a double-release<br/>            # mess.<br/>            response_conn = conn if not release_conn else None<br/>    <br/>            # Make the request on the HTTPConnection object<br/>&gt;           response = self._make_request(<br/>                conn,<br/>                method,<br/>                url,<br/>                timeout=timeout_obj,<br/>                body=body,<br/>                headers=headers,<br/>                chunked=chunked,<br/>                retries=retries,<br/>                response_conn=response_conn,<br/>                preload_content=preload_content,<br/>                decode_content=decode_content,<br/>                **response_kw,<br/>            )<br/><br/>.venv\lib\site-packages\urllib3\connectionpool.py:789: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\connectionpool.py:495: in _make_request<br/>    conn.request(<br/>.venv\lib\site-packages\urllib3\connection.py:441: in request<br/>    self.endheaders()<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:1225: in endheaders<br/>    self._send_output(message_body, encode_chunked=encode_chunked)<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:1004: in _send_output<br/>    self.send(msg)<br/>C:\Users\15220\AppData\Local\Programs\Python\Python38\lib\http\client.py:944: in send<br/>    self.connect()<br/>.venv\lib\site-packages\urllib3\connection.py:279: in connect<br/>    self.sock = self._new_conn()<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = &lt;urllib3.connection.HTTPConnection object at 0x000001E26E2880D0&gt;<br/><br/>    def _new_conn(self) -&gt; socket.socket:<br/>        &quot;&quot;&quot;Establish a socket connection and set nodelay settings on it.<br/>    <br/>        :return: New socket connection.<br/>        &quot;&quot;&quot;<br/>        try:<br/>            sock = connection.create_connection(<br/>                (self._dns_host, self.port),<br/>                self.timeout,<br/>                source_address=self.source_address,<br/>                socket_options=self.socket_options,<br/>            )<br/>        except socket.gaierror as e:<br/>            raise NameResolutionError(self.host, self, e) from e<br/>        except SocketTimeout as e:<br/>            raise ConnectTimeoutError(<br/>                self,<br/>                f&quot;Connection to {self.host} timed out. (connect timeout={self.timeout})&quot;,<br/>            ) from e<br/>    <br/>        except OSError as e:<br/>&gt;           raise NewConnectionError(<br/>                self, f&quot;Failed to establish a new connection: {e}&quot;<br/>            ) from e<br/><span class="error">E           urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x000001E26E2880D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。</span><br/><br/>.venv\lib\site-packages\urllib3\connection.py:214: NewConnectionError<br/><br/>The above exception was the direct cause of the following exception:<br/><br/>self = &lt;requests.adapters.HTTPAdapter object at 0x000001E26DEEC850&gt;<br/>request = &lt;PreparedRequest [PUT]&gt;, stream = False<br/>timeout = Timeout(connect=None, read=None, total=None), verify = True<br/>cert = None, proxies = OrderedDict()<br/><br/>    def send(<br/>        self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None<br/>    ):<br/>        &quot;&quot;&quot;Sends PreparedRequest object. Returns Response object.<br/>    <br/>        :param request: The :class:`PreparedRequest &lt;PreparedRequest&gt;` being sent.<br/>        :param stream: (optional) Whether to stream the request content.<br/>        :param timeout: (optional) How long to wait for the server to send<br/>            data before giving up, as a float, or a :ref:`(connect timeout,<br/>            read timeout) &lt;timeouts&gt;` tuple.<br/>        :type timeout: float or tuple or urllib3 Timeout object<br/>        :param verify: (optional) Either a boolean, in which case it controls whether<br/>            we verify the server&#x27;s TLS certificate, or a string, in which case it<br/>            must be a path to a CA bundle to use<br/>        :param cert: (optional) Any user-provided SSL certificate to be trusted.<br/>        :param proxies: (optional) The proxies dictionary to apply to the request.<br/>        :rtype: requests.Response<br/>        &quot;&quot;&quot;<br/>    <br/>        try:<br/>            conn = self.get_connection_with_tls_context(<br/>                request, verify, proxies=proxies, cert=cert<br/>            )<br/>        except LocationValueError as e:<br/>            raise InvalidURL(e, request=request)<br/>    <br/>        self.cert_verify(conn, request.url, verify, cert)<br/>        url = self.request_url(request, proxies)<br/>        self.add_headers(<br/>            request,<br/>            stream=stream,<br/>            timeout=timeout,<br/>            verify=verify,<br/>            cert=cert,<br/>            proxies=proxies,<br/>        )<br/>    <br/>        chunked = not (request.body is None or &quot;Content-Length&quot; in request.headers)<br/>    <br/>        if isinstance(timeout, tuple):<br/>            try:<br/>                connect, read = timeout<br/>                timeout = TimeoutSauce(connect=connect, read=read)<br/>            except ValueError:<br/>                raise ValueError(<br/>                    f&quot;Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, &quot;<br/>                    f&quot;or a single float to set both timeouts to the same value.&quot;<br/>                )<br/>        elif isinstance(timeout, TimeoutSauce):<br/>            pass<br/>        else:<br/>            timeout = TimeoutSauce(connect=timeout, read=timeout)<br/>    <br/>        try:<br/>&gt;           resp = conn.urlopen(<br/>                method=request.method,<br/>                url=url,<br/>                body=request.body,<br/>                headers=request.headers,<br/>                redirect=False,<br/>                assert_same_host=False,<br/>                preload_content=False,<br/>                decode_content=False,<br/>                retries=self.max_retries,<br/>                timeout=timeout,<br/>                chunked=chunked,<br/>            )<br/><br/>.venv\lib\site-packages\requests\adapters.py:667: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>.venv\lib\site-packages\urllib3\connectionpool.py:843: in urlopen<br/>    retries = retries.increment(<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = Retry(total=0, connect=None, read=False, redirect=None, status=None)<br/>method = &#x27;PUT&#x27;, url = &#x27;/editBook/4&#x27;, response = None<br/>error = NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26E2880D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;)<br/>_pool = &lt;urllib3.connectionpool.HTTPConnectionPool object at 0x000001E26DEECBB0&gt;<br/>_stacktrace = &lt;traceback object at 0x000001E26E33E900&gt;<br/><br/>    def increment(<br/>        self,<br/>        method: str | None = None,<br/>        url: str | None = None,<br/>        response: BaseHTTPResponse | None = None,<br/>        error: Exception | None = None,<br/>        _pool: ConnectionPool | None = None,<br/>        _stacktrace: TracebackType | None = None,<br/>    ) -&gt; Self:<br/>        &quot;&quot;&quot;Return a new Retry object with incremented retry counters.<br/>    <br/>        :param response: A response object, or None, if the server did not<br/>            return a response.<br/>        :type response: :class:`~urllib3.response.BaseHTTPResponse`<br/>        :param Exception error: An error encountered during the request, or<br/>            None if the response was received successfully.<br/>    <br/>        :return: A new ``Retry`` object.<br/>        &quot;&quot;&quot;<br/>        if self.total is False and error:<br/>            # Disabled, indicate to re-raise the error.<br/>            raise reraise(type(error), error, _stacktrace)<br/>    <br/>        total = self.total<br/>        if total is not None:<br/>            total -= 1<br/>    <br/>        connect = self.connect<br/>        read = self.read<br/>        redirect = self.redirect<br/>        status_count = self.status<br/>        other = self.other<br/>        cause = &quot;unknown&quot;<br/>        status = None<br/>        redirect_location = None<br/>    <br/>        if error and self._is_connection_error(error):<br/>            # Connect retry?<br/>            if connect is False:<br/>                raise reraise(type(error), error, _stacktrace)<br/>            elif connect is not None:<br/>                connect -= 1<br/>    <br/>        elif error and self._is_read_error(error):<br/>            # Read retry?<br/>            if read is False or method is None or not self._is_method_retryable(method):<br/>                raise reraise(type(error), error, _stacktrace)<br/>            elif read is not None:<br/>                read -= 1<br/>    <br/>        elif error:<br/>            # Other retry?<br/>            if other is not None:<br/>                other -= 1<br/>    <br/>        elif response and response.get_redirect_location():<br/>            # Redirect retry?<br/>            if redirect is not None:<br/>                redirect -= 1<br/>            cause = &quot;too many redirects&quot;<br/>            response_redirect_location = response.get_redirect_location()<br/>            if response_redirect_location:<br/>                redirect_location = response_redirect_location<br/>            status = response.status<br/>    <br/>        else:<br/>            # Incrementing because of a server error like a 500 in<br/>            # status_forcelist and the given method is in the allowed_methods<br/>            cause = ResponseError.GENERIC_ERROR<br/>            if response and response.status:<br/>                if status_count is not None:<br/>                    status_count -= 1<br/>                cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status)<br/>                status = response.status<br/>    <br/>        history = self.history + (<br/>            RequestHistory(method, url, error, status, redirect_location),<br/>        )<br/>    <br/>        new_retry = self.new(<br/>            total=total,<br/>            connect=connect,<br/>            read=read,<br/>            redirect=redirect,<br/>            status=status_count,<br/>            other=other,<br/>            history=history,<br/>        )<br/>    <br/>        if new_retry.is_exhausted():<br/>            reason = error or ResponseError(cause)<br/>&gt;           raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]<br/><span class="error">E           urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#x27;127.0.0.1&#x27;, port=8000): Max retries exceeded with url: /editBook/4 (Caused by NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26E2880D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;))</span><br/><br/>.venv\lib\site-packages\urllib3\util\retry.py:519: MaxRetryError<br/><br/>During handling of the above exception, another exception occurred:<br/><br/>self = &lt;conftest.TestGqzy1 object at 0x000001E26DEEC460&gt;<br/>api_tool = &lt;Tool.tools.ApiRequestTool object at 0x000001E26DEEC520&gt;, id = 14<br/>book = &#x27;红楼梦&#x27;, status = 1, fl = &#x27;历史&#x27;<br/><br/>    @pytest.mark.parametrize(&quot;id,book,status,fl&quot;, get_yaml_data())<br/>    def test_put_putbook1(self,api_tool,id,book,status,fl):<br/>        print(&quot;\n==========修改图书===========&quot;)<br/>        putbook = {&quot;id&quot;: id, &quot;book&quot;: book, &quot;status&quot;: status, &quot;fl&quot;: fl}<br/>&gt;       status_code, response_text, response = api_tool.put(path=PUT_BOOK, json=putbook)<br/><br/>conftest\conftest.py:101: <br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/>Tool\tools.py:24: in put<br/>    response = self.session.put(full_url,data=data,headers=head,json=json)<br/>.venv\lib\site-packages\requests\sessions.py:649: in put<br/>    return self.request(&quot;PUT&quot;, url, data=data, **kwargs)<br/>.venv\lib\site-packages\requests\sessions.py:589: in request<br/>    resp = self.send(prep, **send_kwargs)<br/>.venv\lib\site-packages\requests\sessions.py:703: in send<br/>    r = adapter.send(request, **kwargs)<br/>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _<br/><br/>self = &lt;requests.adapters.HTTPAdapter object at 0x000001E26DEEC850&gt;<br/>request = &lt;PreparedRequest [PUT]&gt;, stream = False<br/>timeout = Timeout(connect=None, read=None, total=None), verify = True<br/>cert = None, proxies = OrderedDict()<br/><br/>    def send(<br/>        self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None<br/>    ):<br/>        &quot;&quot;&quot;Sends PreparedRequest object. Returns Response object.<br/>    <br/>        :param request: The :class:`PreparedRequest &lt;PreparedRequest&gt;` being sent.<br/>        :param stream: (optional) Whether to stream the request content.<br/>        :param timeout: (optional) How long to wait for the server to send<br/>            data before giving up, as a float, or a :ref:`(connect timeout,<br/>            read timeout) &lt;timeouts&gt;` tuple.<br/>        :type timeout: float or tuple or urllib3 Timeout object<br/>        :param verify: (optional) Either a boolean, in which case it controls whether<br/>            we verify the server&#x27;s TLS certificate, or a string, in which case it<br/>            must be a path to a CA bundle to use<br/>        :param cert: (optional) Any user-provided SSL certificate to be trusted.<br/>        :param proxies: (optional) The proxies dictionary to apply to the request.<br/>        :rtype: requests.Response<br/>        &quot;&quot;&quot;<br/>    <br/>        try:<br/>            conn = self.get_connection_with_tls_context(<br/>                request, verify, proxies=proxies, cert=cert<br/>            )<br/>        except LocationValueError as e:<br/>            raise InvalidURL(e, request=request)<br/>    <br/>        self.cert_verify(conn, request.url, verify, cert)<br/>        url = self.request_url(request, proxies)<br/>        self.add_headers(<br/>            request,<br/>            stream=stream,<br/>            timeout=timeout,<br/>            verify=verify,<br/>            cert=cert,<br/>            proxies=proxies,<br/>        )<br/>    <br/>        chunked = not (request.body is None or &quot;Content-Length&quot; in request.headers)<br/>    <br/>        if isinstance(timeout, tuple):<br/>            try:<br/>                connect, read = timeout<br/>                timeout = TimeoutSauce(connect=connect, read=read)<br/>            except ValueError:<br/>                raise ValueError(<br/>                    f&quot;Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, &quot;<br/>                    f&quot;or a single float to set both timeouts to the same value.&quot;<br/>                )<br/>        elif isinstance(timeout, TimeoutSauce):<br/>            pass<br/>        else:<br/>            timeout = TimeoutSauce(connect=timeout, read=timeout)<br/>    <br/>        try:<br/>            resp = conn.urlopen(<br/>                method=request.method,<br/>                url=url,<br/>                body=request.body,<br/>                headers=request.headers,<br/>                redirect=False,<br/>                assert_same_host=False,<br/>                preload_content=False,<br/>                decode_content=False,<br/>                retries=self.max_retries,<br/>                timeout=timeout,<br/>                chunked=chunked,<br/>            )<br/>    <br/>        except (ProtocolError, OSError) as err:<br/>            raise ConnectionError(err, request=request)<br/>    <br/>        except MaxRetryError as e:<br/>            if isinstance(e.reason, ConnectTimeoutError):<br/>                # TODO: Remove this in 3.0.0: see #2811<br/>                if not isinstance(e.reason, NewConnectionError):<br/>                    raise ConnectTimeout(e, request=request)<br/>    <br/>            if isinstance(e.reason, ResponseError):<br/>                raise RetryError(e, request=request)<br/>    <br/>            if isinstance(e.reason, _ProxyError):<br/>                raise ProxyError(e, request=request)<br/>    <br/>            if isinstance(e.reason, _SSLError):<br/>                # This branch is for urllib3 v1.22 and later.<br/>                raise SSLError(e, request=request)<br/>    <br/>&gt;           raise ConnectionError(e, request=request)<br/><span class="error">E           requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#x27;127.0.0.1&#x27;, port=8000): Max retries exceeded with url: /editBook/4 (Caused by NewConnectionError(&#x27;&lt;urllib3.connection.HTTPConnection object at 0x000001E26E2880D0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝，无法连接。&#x27;))</span><br/><br/>.venv\lib\site-packages\requests\adapters.py:700: ConnectionError<br/> ------------------------------Captured stdout call------------------------------ <br/>
==========修改图书===========
<br/></div></td></tr></tbody></table></body></html>